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

Popular posts from this blog

java - Jmockit String final length method mocking Issue -

asp.net - Razor Page Hosted on IIS 6 Fails Every Morning -

c++ - wxwidget compiling on windows command prompt -