当我包含newstext时,我正在动态生成xml
文件并出现错误。!
通过删除新闻文本生成完美。这是我正在使用的代码。Error: XML Parsing Error: undefined entity
xml
$sqlNews = "SELECT * FROM news";
$runSqlNews = mysql_query($sqlNews);
while ($rowSqlNews = mysql_fetch_array($runSqlNews))
$arrSqlNews[] = $rowSqlNews;
header('Content-type: text/xml');
header('Pragma: public');
header('Cache-control: private');
header('Expires: -1');
echo "<?xml version=\"1.0\" encoding=\"utf-8\"?>";
echo '<xml>';
for($i=0;$i<count($arrSqlNews);$i++)
{
echo "<news>";
echo "<newsId>".$arrSqlNews[$i][id]."</newsId>";
echo "<newsAuthor>".$arrSqlNews[$i][news_author]."</newsAuthor>";
echo "<newsText>".$arrSqlNews[$i][news_text]."</newsText>";
echo "<description>".$arrSqlNews[$i][news_description]."</description>";
echo "<image>".$arrSqlNews[$i][news_image]."</image>";
echo "</news>";
}
echo '</xml>';
希望我的问题很清楚。提前致谢 !!