PaulEx10 PaulEx10 - 1 year ago 81
PHP Question

Get FB Full Name by ID

Is it possible to get somebody's Facebook name by ID?

It's possible to get it by file_get_contents but it's disabled on my server I'm afraid. I believe there's a curl work around but I've not used much curl before so I'm not quite sure what to use.

$pageContent = file_get_contents('');
$parsedJson = json_decode($pageContent);
echo $parsedJson->name;

Any help is greatly appreciated.

Answer Source

You can use cURL, like so:

$url = '';

$ch = curl_init();
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
$result = curl_exec($ch);

$result = json_decode($result);
echo $result->name;


Mark Zuckerberg
Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download