Getting email from facebook

I'm having trouble getting the email from facebook.

$user_id = $data->user->identity->emails->value;

But it throws this error: Notice: Trying to get property of non-object on the line above.


Best Answer

  • Answer ✓
    Nevermind....

    $user_id = $data->user->identity->emails[0]->value;

    Is what I needed.
    Sign In or Register to comment.