【问题标题】:Need help decoding JSON output with PHP需要帮助使用 PHP 解码 JSON 输出
【发布时间】:2014-04-09 21:13:12
【问题描述】:

这是我正在使用的示例 JSON 输出:

http://maps.google.com/maps/api/geocode/json?components=postal_code:90210&sensor=false

这是从该位置提取纬度值的尝试:

$postalLong = $jsonOutput>results[0]->formatted_address[0]->location[1]->lng;   

我尝试了几种变体,但都不起作用。如何将34.1030032 值应用于此变量?

【问题讨论】:

  • $json->results[0]->geometry->location->lat;怎么样

标签: php json google-maps variables decode


【解决方案1】:

我猜你错了。试试这个 -

$json->results[0]->geometry->location->lat;

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 2014-08-24
    • 2021-10-23
    • 2019-05-03
    • 2018-12-11
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多