开发者

how to get the work and educational details from facebook?

开发者 https://www.devze.com 2023-02-15 10:50 出处:网络
using access token i go user details. $fb_id_url = \"https://graph.facebook.com/me?access_token=\".$access_token;

using access token i go user details.

$fb_id_url = "https://graph.facebook.com/me?access_token=".$access_token;
$fb_info_json = file_get_contents($fb_id_url);
$fb_info=json_decode($fb_info_json,true);  ------ converting to array

my problem is, not able to get work details because it is miti-dimensional

$fb_info['id'] --- fine,  id is printed

echo $fb_info['work'][0][0]; ----- error
echo $fb_info['work']       ------ printing: "Array"
echo $fb_info['work']['employer']['id'] ----- error    

json output from facebook is;

开发者_开发技巧

"work":[{"employer":{"id":"xxxxxx","name":"xxxx"},"location":{"id":"xxx","name":"xxxx"},"position":{"id":"xxxx","name":"Software engineer"},"description":"Description","start_date":"1996-01"},{"employer":{"id":"106216066077126","name":"xxxx"},"position":{"id":"118197931562602","name":"Maneger"},"description":"desc"},


echo $fb_info['work'][0]['employer']['id']

0

精彩评论

暂无评论...
验证码 换一张
取 消