当键包含PHP期间时,如何选择JSON值
我正在从我的Cube E-Bike从Raspberry Pi到我的网站上回复此JSON,看起来像这样:
{
"result": [
{
"telemetry": {
"actual.remaining.mileage": 26.81,
"position": {
"altitude": 0,
"direction": 0,
"latitude": 34.799687,
"longitude": 7.478863,
"satellites": 0,
"speed": 0
},
"position.altitude": 0,
"vehicle.mileage": 624.071
},
"connected": true
}
]
}
我该如何访问我尝试查看已经存在的线程的PHP的人,但是由于我的JSON获得了一些名称,包括”。 “我无法工作。
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
您可以使用本机PHP函数 json_decode并像下面的那样访问它:
You can convert the JSON to a PHP array using the native PHP function json_decode and access it like below: