Facebook PHP code can't get name -


I am trying to write the PHP code which will display the name of the logged user. So far I have got to show the user's ID but can not get the name to show me.

  & lt ;? Php $ app_id = "..."; $ Canvas_page = "..."; $ Auth_url = "http://www.facebook.com/dialog/oauth?client_id=" $ App_id "& amp; redirect_uri =" urlencode ($ canvas_page); $ Sign_request = $ _REQUEST ["signed_required"]; List ($ encoded_sig, $ payload) = explosion ('.', $ Sign_request, 2); $ Data = json_decode (base64_decode ($ payload) is true); If (empty ($ data ["user_id"]) {echo ("& lt; script> top position. Hri = '" $ auth_url. "' '' / Script & gt;");} Else { Reverberating ("Welcome User:". $ Data ['user_id']);}? & Gt;   

Changing 'user_id' to 'name' or 'first_name' does not show anything

Hit the / me API to get you user data

If you want to use PHP, why do not you check?

Comments