So This helpful entry hopefully helps some one trying to dynamically retrieve some facebook id for the the fan page the user is currently looking at.
I searched the Facebook documentation and referred consistently to this but didn't straight explain how to get this dynamic variable in php.
So it's quite simple really once you find it but you can see it here: This will allow you to retrieve the current page's id... no need to curl it and parse the id, it's right here.
<?php
print $_REQUEST['fb_sig_page_id'];
?>
We used this is the implementation and delivery of the juno wallet facebook fanpage application which can be seen here:
http://www.facebook.com/pages/Apollo-Matrix-LLC/120845234620618?v=app_13...
hope this helps, and as always apollo matrix can help with all of your face book apps...