我有一个 json 数据,我试图从该 json 中获取经度和纬度。
这是JSON代码
{
"0": {
"provider": "gps",
"time": 1517235370666,
"latitude": 31.501278877258,
"longitude": 74.366261959076,
"accuracy": 63,
"speed": 2.1400001049042,
"altitude": 181,
"bearing": 28.125,
"locationProvider": 0
}
}
我想要纬度和经度。我用 json_decode 解析它,但我仍然无法得到。
解析后
stdClass Object
(
[0] => stdClass Object
(
[provider] => gps
[time] => 1517235370666
[latitude] => 31.501278877258
[longitude] => 74.366261959076
[accuracy] => 63
[speed] => 2.1400001049042
[altitude] => 181
[bearing] => 28.125
[locationProvider] => 0
)
)