Matt Andrzejczuk
Matt Andrzejczuk

Reputation: 2066

user location returns a string: "Array" Facebook

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

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

The code above is returning "Location: Array". Is this a Facebook API problem or does this require specific permissions?

Upvotes: 0

Views: 362

Answers (1)

Sahil Mittal
Sahil Mittal

Reputation: 20753

You have to print like this-

print_r($user_location['location']);

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

Upvotes: 1

Related Questions