PHP错误:SimpleXMLElement::\uu构造()

PHP错误:SimpleXMLElement::\uu构造(),php,xml,rss,Php,Xml,Rss,出于某种原因,我使用脚本将feedburner计数作为字符串在我的站点中使用(http://ios-blog.co.uk)已停止工作:(这是它抛出的错误: Warning: SimpleXMLElement::__construct() [simplexmlelement.--construct]: Entity: line 2: parser error : Opening and ending tag mismatch: meta line 1 and HEAD in /home/c

出于某种原因,我使用脚本将feedburner计数作为字符串在我的站点中使用(http://ios-blog.co.uk)已停止工作:(这是它抛出的错误:

Warning: SimpleXMLElement::__construct() [simplexmlelement.--construct]: Entity: line 2:     parser error : Opening and ending tag mismatch: meta line 1 and HEAD in /home/connect.php on line 83

Warning: SimpleXMLElement::__construct() [simplexmlelement.--construct]: <TITLE>301 Moved</TITLE></HEAD><BODY> in /home/connect.php on line 83

Warning: SimpleXMLElement::__construct() [simplexmlelement.--construct]: ^ in /home/connect.php on line 83

Warning: SimpleXMLElement::__construct() [simplexmlelement.--construct]: Entity: line 6: parser error : Opening and ending tag mismatch: HEAD line 1 and HTML in /home/connect.php on line 83

Warning: SimpleXMLElement::__construct() [simplexmlelement.--construct]: </BODY></HTML> in /home/connect.php on line 83

Warning: SimpleXMLElement::__construct() [simplexmlelement.--construct]: ^ in /home/connect.php on line 83

Warning: SimpleXMLElement::__construct() [simplexmlelement.--construct]: Entity: line 7: parser error : Premature end of data in tag HTML line 1 in /home/connect.php on line 83

Warning: SimpleXMLElement::__construct() [simplexmlelement.--construct]: in /home/connect.php on line 83

Warning: SimpleXMLElement::__construct() [simplexmlelement.--construct]: ^ in /home/connect.php on line 83

Fatal error: Uncaught exception 'Exception' with message 'String could not be parsed as XML' in /home/connect.php:83 Stack trace: #0 /home/connect.php(83): SimpleXMLElement->__construct('<HTML><HEAD><me...') #1 {main} thrown in /home/connect.php on line 83
这个文件很大,上面写着与之相关的第83行:
$xml=newsimplexmlement($data);


谢谢你的帮助:)

在这条线上看一下这里

警告:SimpleXMLElement::u construct()[SimpleXMLElement.-construct]:301在第83行的/home/connect.php中移动

它正在移动HTTP代码301

如果您访问此链接


它实际上是404ing,没有XML。

请看这一行

警告:SimpleXMLElement::u construct()[SimpleXMLElement.-construct]:301在第83行的/home/connect.php中移动

它正在移动HTTP代码301

如果您访问此链接


它实际上是404,没有XML。

啊。。。feedburner现在已弃用-这就是它突然停止的原因:(

啊…feedburner现在已弃用-这就是它突然停止的原因:)

//get cool feedburner count
$whaturl="http://api.feedburner.com/awareness/1.0/GetFeedData?uri=iosdevblog";

//Initialize the Curl session
$ch = curl_init();

//Set curl to return the data instead of printing it to the browser.
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);

//Set the URL
curl_setopt($ch, CURLOPT_URL, $whaturl);

//Execute the fetch
$data = curl_exec($ch);

//Close the connection
curl_close($ch);
$xml = new SimpleXMLElement($data);
$fb = $xml->feed->entry['circulation'];
echo $fb;
//end get cool feedburner count