我正在使用 FeedBurner Awareness API。像这样的 XML 数据:
<rsp stat="ok">
−
<!--
This information is part of the FeedBurner Awareness API. If you want to hide this information, you may do so via your FeedBurner Account.
-->
−
<feed id="9n66llmt1frfir51p0oa367ru4" uri="teknoblogo">
<entry date="2011-01-15" circulation="11" hits="18" reach="0"/>
</feed>
</rsp>
我想获取流通数据 (11) 。我正在使用这段代码:
$whaturl="https://feedburner.google.com/api/awareness/1.0/GetFeedData?uri=teknoblogo";
//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;
echo "OK";
但是,返回的数据是空白的。没有任何错误。只返回OK。我该如何解决这个问题?
编辑:回声 $data; 也返回空白。