我想用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