How can do I use:
‘https://graph.facebook.com/“.$data[“user_id”].”?access_token=”.$data[“oauth_token”]’
After the user accepts my application I can go to this page and see their information. I need a function that will return these values from this page into variables that I can use.
I would suggest using the official Facebook PHP SDK, a set of PHP classes allowing you to interact with the Graph API.
https://github.com/facebook/php-sdk
If you really want to do it by hand: the Facebook API returns it’s data in the JSON format.
In PHP you can first grab the content of the url ( really easy way: $result = file_get_contents(‘https://…..’); ) and then turn it into a regular structured php array with