我有以下json: -
{
"firstName": "Jhon",
"lastName": "Doe",
"username": "jhon",
"avatar": "localhost/uploads/avatars/default.jpg",
"language": "ar",
"birth_date": "2017-11-22 00:00:00",
"weight_chart": [],
"health_status": {
"id": 130,
"user_id": 258,
"weight": 95,
"height": 171,
},
我解码了上面的json
$user = json_decode($response);
现在我可以使用以下方式打印名字: $用户>的firstName
我的问题是: -
答案 0 :(得分:2)
您的json格式不正确,请尝试以下结构:
Jhon - 130 - 95
回复:{{1}}