0

我似乎无法走出大门。我有以下内容,除了白屏之外什么都没有......

    <?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); 
?>

不知道我做错了什么。

谢谢你的帮助!!

4

1 回答 1

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关闭,这将是一个空白页。

于 2013-08-26T22:03:31.993 回答