我想用PHP來創建一個XML文件中的一些XML,但我不能讓它的工作生成XML與PHP
XML文件
<?xml version="1.0">
<streams>
<stream>test</stream>
</streams>
的PHP
<?php
header("Content-type: text/xml");
$xml = simplexml_load_file("t.xml");
$html = "<?xml version='1.0'>";
$html = $html . "<streams>";
foreach($xml->stream as $stream)
{
$html= $html . "<stream>";
$html = $html . "<![CDATA[" . $stream->title . "]]>";
$html= $html . "</stream>";
}
$html = $html . "</streams>";
echo $html;
?>
錯誤
Error: This page contains the following errors: error on line 2 at column 1:
Extra content at the end of the document Below is a rendering of the page up
to the first error.
問題是什麼? –
問題是什麼?爲什麼它不工作?什麼是錯誤..你能解釋嗎? –
解釋什麼是問題,表現出你的努力和錯誤,您越來越 – NoNaMe