Php chrome上文档末尾的额外内容
此url在chrome上的文档末尾提供了额外的内容 我的密码是Php chrome上文档末尾的额外内容,php,mysql,xml,Php,Mysql,Xml,此url在chrome上的文档末尾提供了额外的内容 我的密码是 function showrss() { header("Content-Type: application/xml; charset=ISO-8859-1"); $query_items = "select * from articles"; $result_items = mysql_query ($query_items) or die("Some error: ".mysql_error()
function showrss() {
header("Content-Type: application/xml; charset=ISO-8859-1");
$query_items = "select * from articles";
$result_items = mysql_query ($query_items) or die("Some error: ".mysql_error());
$xml = '<?xml version="1.0" encoding="ISO-8859-1" ?><rss version="2.0"><channel>';
while($row = mysql_fetch_array($result_items))
{
//$des = mysql_real_escape_string($row['a_description']);
// $a_des = str_replace(']]>', ']]>',$row['a_description']);
//$a_des = strip_tags($row['a_description']);
// $a_des = preg_replace('/[^a-zA-Z0-9\s]/', '', strip_tags($row['a_description']));
$a_des = htmlspecialchars($row['a_description']);
$xml .= '<item>
<title>'.$row["a_title"].'</title>
<link>'.$row["a_url"].'</link>
<description>'.$a_des.'</description></item>';
} $xml .= '</channel>';
$xml .= '</rss></xml>';
echo $xml;}
函数showrss(){
标题(“内容类型:application/xml;charset=ISO-8859-1”);
$query\u items=“从文章中选择*”;
$result\u items=mysql\u query($query\u items)或die(“某些错误:”.mysql\u error());
$xml='';
while($row=mysql\u fetch\u数组($result\u items))
{
//$des=mysql\u real\u escape\u字符串($row['a\u description']);
//$a_des=str_replace(']]>',']]',$row['a_description']);
//$a_des=strip_标签($row['a_description']);
//$a_des=preg_replace('/[^a-zA-Z0-9\s]/','',带标签($a_description']);
$a_des=htmlspecialchars($row['a_description']);
$xml.='
“.$row[“a_title”]”
“.$row[“a_url”]”
“.$a_des.”;
}$xml.='';
$xml.='';
echo$xml;}
这是因为末尾有额外的
结束标记(没有开始标记)