簡體   English   中英

需要幫助以PHP解碼JSON輸出

[英]Need help decoding JSON output with PHP

這是我正在使用的示例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;

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM