I tried the curl as the filegetcontents now working in php can any one give me the solution so solve it using curl here is the code
$userData = json_decode(file_
How about this:
$cFb = curl_init(
'https://graph.facebook.com/me?access_token='.$token.'&fields=name,id'
);
curl_setopt($cFb, CURLOPT_RETURNTRANSFER, true);
$userData = json_decode(curl_exec($cFb), true);
curl_close($cFb);
print($userData['id']).'
';
Although, as suggested by Abhik Chakraborty in the comments, it's probably worth looking into using the official Facebook PHP SDK. The SDK uses curl so it should work in your hosting environment.