How to obtain the facebook image? Or even save it to this machine?

about facebook login!

clipboard.png

print out getPicture () in this format:

{"height":50,"is_silhouette":false,"url":"https:\/\/lookaside.facebook.com\/platform\/profilepic\/?asid=xxx&height=50&width=50&ext=xxx&hash=xxsxsxsxsxs","width":50}

how do I directly capture the value? of url key

Mar.14,2021

$me = $response->getGraphUser();
$pictureJson = $me->getPicture();
$pictureItem = json_decode($pictureJson,true);
echo $pictureItem['url'];

probably converts this json string into a PHP array. And then deal with it.

Menu