Match newline with preg_replace
Posted on 2006-06-15
I am using fget to grab a page from another directory on my site and display it in a window on my main page. I am trying to trim out the footers and extra stuff I don't want displayed twice. The tags I need to grab and replace are as follows
And I want to replace that with a single
I can't seem to get the regular expression quite right however, please help me express my regex
$itemdetail = preg_replace("/<\/div>+(^[\r\n]*|[\r\n]+|[^\s]+)<hr \/>/", "</div>", $itemdetail);
I've tried everything I can think of to match the newline in between the two tags and still can't match it, please help.
Thanks in advance,