Email address and other user information from Facebook, with permission
Before that you must have
Facebook app id and secret id, these values ββcan be created from under the link when you log in to facebook
https://developers.facebook.com/apps
follow the steps to create applications and you will automatically close the keys

Step 0
do test.php and below content
<html> <head> <title>My Facebook Login Page</title> </head> <body> <div id="fb-root"></div> <script> window.fbAsyncInit = function() { FB.init({ appId : 'YOUR_APP_ID', status : true, cookie : true, xfbml : true, oauth : true, }); }; (function(d){ var js, id = 'facebook-jssdk'; if (d.getElementById(id)) {return;} js = d.createElement('script'); js.id = id; js.async = true; js.src = "//connect.facebook.net/en_US/all.js"; d.getElementsByTagName('head')[0].appendChild(js); }(document)); </script> <div class="fb-login-button" scope="email,user_checkins"> Login with Facebook </div> </body> </html>

Step 1
Download Facebook php-sdk from the link below.
https://github.com/facebook/php-sdk update Dec 23, 2012 https://github.com/facebook/facebook-php-sdk
paste it into the working directory and extract it and rename it as facebook-php-sdk
Step 2
https://developers.facebook.com/docs/guides/web/
You can copy the code below from the link above,
or below code, fully functional and perfectly designed to recover email and other information.
<?php define('YOUR_APP_ID', '99999998558585'); //uses the PHP SDK. Download from https://github.com/facebook/php-sdk require 'facebook-php-sdk/facebook.php'; $facebook = new Facebook(array( 'appId' => '99999998558585', 'secret' => 'h4h23jh4lk23j432j42bdaf', )); $userId = $facebook->getUser(); echo "FB User Id : " . $userId; $userInfo = $facebook->api('/me'); echo "<pre>"; print_r($userInfo); echo "</pre>"; ?>
and added image for convenience
and the final output will be displayed on the image
