使用访问令牌我去了用户详细信息。
$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
我的问题是,无法获得工作细节,因为它是有维度的
$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
来自facebook的json输出是
“工作”:[{ “雇主”:{ “ID”: “XXXXXX”, “姓名”: “XXXX”}, “位置”:{ “ID”: “XXX”, “名称”:“XXXX “},” 位置 “:{” ID “:” XXXX “ ”名“:” 软件 工程师 “},” 说明 “:” 说明”, “起始日期”: “1996年至1901年”},{ “雇主”:{ “ID”: “106216066077126”, “名”: “XXXX”}, “位置”: { “ID”: “118197931562602”, “名称”: “Maneger”}, “说明”: “递减”},
答案 0 :(得分:1)
echo $fb_info['work'][0]['employer']['id']