到目前为止,我已经尝试过:
$facebook->api('/me', 'get', array("fields"=>"location"));
返回:
Array ( [location] => Array ( [id] => 107847249250173 [name] => Cambridge, Cambridgeshire ) [id] => 1234567890 )
如果我有必要的权限,我怎么能以一种可以插入数据库的格式回显[name]
位(所以输出是#34; Cambridge,Cambridgeshire")? / p>
答案 0 :(得分:2)
$data = $facebook->api('/me', 'get', array("fields"=>"location"));
echo $data['location']['name'];