PHP tutorials,a way to getting some thing new in web

Followers

Powered by Blogger.

Friday 1 August 2014

How to get Facebook ID from Facebook page

No comments :



The following code will help you to get facebook page id from facebook page name.



function getFacebookId($url) {

    $id =  substr(strrchr($url,'/'),1);

    $json = file_get_contents('http://graph.facebook.com/'.$id);

    $json = json_decode($json);

    return $json->id;

}


echo getFacebookId('https://www.facebook.com/pagename');



No comments :

Post a Comment