I\'ve got the Facebook user ID of the user who created a given page. Now I need to get the page ID to display like box in my website.
Different users have their own Face
I am presuming that you are the user and you want the page id of a page that you are the admin of.
To get the id is fairly straightforward.
First, you need to get a list of all pages associated with the user id:
$fanpages = $facebook->api('me/accounts?access_token='.$accessToken);
You would then do a loop like:
foreach ($fanpages['data'] as $fanpage)
{
echo "
Fan Page Name: ".$fanpage['name'] . " ID: ".$fanpage['id'];
}
That would list all the pages associated with the id.
For a full list of the elements of the $fanpage array, take a look here:
https://developers.facebook.com/docs/reference/api/page/