The following code is inside a file called facebook_posts.php which I call from my index file like so:
all what you need to get latest posts from facebook feed is described here: http://piotrpasich.com/facebook-fanpage-feed/
In shortcut - use your fanpage feed (please replace {id} by proper id)
https://facebook.com/feeds/page.php?format=atom10&id={id}
You can download the feed with this piece of code:
$curl = curl_init();
curl_setopt($curl, CURLOPT_URL, $rss_url);
curl_setopt($curl, CURLOPT_USERAGENT, 'Mozilla/4.0 (compatible; MSIE 7.0; Windows NT 5.1; .NET CLR 1.0.3705; .NET CLR 1.1.4322; Media Center PC 4.0)');
curl_setopt($curl, CURLOPT_REFERER, '');
curl_setopt($curl, CURLOPT_FOLLOWLOCATION, 1);
curl_setopt($curl, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($curl, CURLOPT_SSL_VERIFYPEER, false);
curl_setopt($curl, CURLOPT_TIMEOUT, 10);
$raw_xml = curl_exec($curl); // execute the curl command