如何取得facebook 頭像?甚至保存到本機來?

關於facebook 登入!

https://img.mukewang.com/5c8f43950001eba202890065.jpg

印出 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?

元芳怎么了
浏览 460回答 1
1回答

幕布斯6054654

$me = $response->getGraphUser(); $pictureJson = $me->getPicture(); $pictureItem = json_decode($pictureJson,true); echo $pictureItem['url']; 大概就是把这个json字符串转换成PHP数组。然后再处理。
打开App,查看更多内容
随时随地看视频慕课网APP