php - Get facebook user email -
i have facebook app , i'm trying user's email,
uncaught oauthexception: unknown path components: /email
on using following code:
$email= idx($facebook->api('me/email'),'data',array()); function idx(array $array, $key, $default = null) { return array_key_exists($key, $array) ? $array[$key] : $default; }
what doing wrong?
that's way use normally:
$user_profile = $fb->api('/me'); $email=$user_profile['email'];
so can it:
$email=idx($facebook->api('/me'),'email',array());
Comments
Post a Comment