Hi I'm just trying to get a hang of regular expressions, i have being trying to extract content from this website but i reckon i have a problem with my regexp, as i cannot add anything to the array. Can anyone point me in the right direction, I reckon its just something small.
Thanks
<?php
$f1 = fopen("http://www.irishexaminer.com/","r");
$document = fread($f1,100000);
fclose($f1);
$regexp = "%<p>(.+)</p><p>%";
preg_match($regexp,$document,$getHeading);
echo "<br>" . $getHeading[1];
echo '<pre>';
print_r($getHeading);
echo '</pre>';
?>
tags such as:
THERE is no excuse for loyalist violence on the streets of Belfast.
– user1344192 Jan 10 '13 at 15:21(.+?)
%"`
– FrankieTheKneeMan Jan 10 '13 at 15:31