關於facebook 登入!
印出 getPicture() 後是這樣的格式:
{"height":50,"is_silhouette":false,"url":"https:\/\/lookaside.facebook.com\/platform\/profilepic\/?asid=xxx&height=50&width=50&ext=xxx&hash=xxsxsxsxsxs","width":50}
我要怎麼直接抓出 url key的value?
1 回答

幕布斯6054654
TA貢獻1876條經驗 獲得超7個贊
$me = $response->getGraphUser();
$pictureJson = $me->getPicture();
$pictureItem = json_decode($pictureJson,true);
echo $pictureItem['url'];
大概就是把這個json字符串轉換成PHP數組。然后再處理。
- 1 回答
- 0 關注
- 478 瀏覽
添加回答
舉報
0/150
提交
取消