I am trying to extract the PHP of links generated in a facebook RSS feed, and make it into simple html once clicked. the links look like this:
http://l.facebook.com/l.php?u=http%3A%2F%2Fwww.theguardian.com%2Ftravel%2F2014%2Fapr%2F25%2Fitaly-puglia-salento-region&h=2AQF4oNrg&s=1
this is the original link:
http://www.theguardian.com/travel/2014/apr/25/italy-puglia-salento-region
I am using this code but seems to be an error on line 2.
$matches = array();
pregmatchall(/http:\/\/l\.facebook\.com\/l\.php\?u=([^"]+)/, $rss, $matches);
foreach($matches[0] as $index => $match) {
$url = urldecode(html_entity_decode($matches[1][$index]));
str_replace($match, $url, $rss);
}