I have the following PHP code :
<?php
require_once 'library/facebook.php';
include '../constants.php';
define('TOKEN_FILE', 'fb_page_accestoken.txt'); // dont need to change this
$fb = new Facebook(array(
'appId' => FB_APP_ID,
'secret' => FB_APP_SECRET,
'cookie' => true,
));
$access_token = file_get_contents('fb_app_token.txt');
$response = "https://graph.facebook.com/me/accounts?access_token=".$access_token;
echo $response;
?>
The above creates a URL to access my Facebook Graph API. When I copy it and paste it in the browser url I get the following:
{
"data": [
{
"category": "Media/news/publishing",
"name": "My Sandbox",
"access_token": "abcdefghijklmnopqrstuvwxyz123456",
"perms": [
"ADMINISTER",
"EDIT_PROFILE",
"CREATE_CONTENT",
"MODERATE_CONTENT",
"CREATE_ADS",
"BASIC_ADMIN"
],
"id": "123456789"
},
How can I extract particular information such as the access_token value in my php file?
Thank you
var_dump(json_decode($response)); var_dump(json_decode($response, true));Nothing worked