[英]json_decode variables php
我只是想從json_decode中提取變量
得到的解碼代碼(片段)為:
auth_info:
array(4) {
["profile"]=>
array(13) {
["name"]=>
array(3) {
["givenName"]=>
string(6) "John"
["familyName"]=>
string(7) "Doe"
["formatted"]=>
string(14) "John Doe"
}
}
}
我正在嘗試所有事情,例如:
echo "\n\nMy name is ".$auth_info['profile']->name->givenName;
但是,一切都沒有。
一如既往的感謝
達倫
它們都是數組,嘗試一下。
$auth_info['profile']['name']['givenName']
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.