關於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 回答
![?](http://img1.sycdn.imooc.com/5333a1bc00014e8302000200-100-100.jpg)
幕布斯6054654
TA贡献1876条经验 获得超7个赞
$me = $response->getGraphUser();
$pictureJson = $me->getPicture();
$pictureItem = json_decode($pictureJson,true);
echo $pictureItem['url'];
大概就是把这个json字符串转换成PHP数组。然后再处理。
- 1 回答
- 0 关注
- 459 浏览
添加回答
举报
0/150
提交
取消