【发布时间】:2015-12-30 10:43:24
【问题描述】:
我正在尝试使用 Openstreetmap 和 PHP 来指向地图上的一个地方。 正如您在下面看到的,我检索了一个 JSON 数组,但 PHP 返回了一个 NULL 值。
请注意,我的$url 是一个有效的 JSON(您可以检查它here)。
<?
$url = 'http://nominatim.openstreetmap.org/search/Piazza%20Duomo%20Trento?format=json&addressdetails=1&limit=1&polygon_svg=1';
$html = file_get_contents($url);
$jsonout = json_decode($html);
echo $jsonout[0];
?>
我做错了什么?
【问题讨论】:
-
你正在尝试
echo对象,为什么它给出了 NULL。
标签: php json null openstreetmap