The output is on JSON which we can decode via PHP, please see sample below.
{
"data": [
{
"friend_count": 740
}
]
}
<?php
$fbUserId = <your facebook id>;
$json = file_get_contents("https://graph.facebook.com/fql?q=SELECT%20friend_count%20FROM%20user%20WHERE%20uid=$fbUserId");
$json = json_decode($json);
echo @$json->data[0]->friend_count;
?>
Hope this helps, please leave a comment if you like this post.