简单的Zillow API调用提供白屏

时间:2013-08-26 21:52:53

标签: zillow

我似乎无法离开大门。 我有以下内容,只有白屏......

    <?php 
 $url = "http://www.zillow.com/webservice/GetDemographics.htm?zws-id=<my api      key>&state=CO&city=Denver&neighborhood=Stapleton";
 $data = simplexml_load_string(file_get_contents($url));
 print_r($data); 
?>

不确定我做错了什么。

感谢你的帮助!!

1 个答案:

答案 0 :(得分:0)

它对我有用,也许你没有用PHP安装libxml?空白屏幕可能是致命错误的结果。

尝试将脚本更改为:

<?php 
error_reporting(E_ALL); // log all errors
ini_set('display_errors', 'on'); // display errors in output, rather than to error_log

$url = "http://www.zillow.com/webservice/GetDemographics.htm?zws-id=<my api      key>&state=CO&city=Denver&neighborhood=Stapleton";
$data = simplexml_load_string(file_get_contents($url));
print_r($data); 

前两行可能会导致显示某种错误消息,如果display_errors关闭,则会显示空白页。