用户位置返回一个字符串:“Array”Facebook

时间:2013-08-22 23:02:33

标签: php facebook facebook-graph-api facebook-php-sdk

$user_location = $facebook->api('/me','GET');

echo " Location: " . $user_location['location'];

上面的代码返回“Location:Array”。这是Facebook API问题还是需要特定权限?

1 个答案:

答案 0 :(得分:1)

你必须像这样打印 -

print_r($user_location['location']);

// location name
echo " Location: " . $user_location['location']['name'];