I've been using something similar to this code to edit pieces of a page. I've simplified the pattern match here for clarity, obviously there's more than one div on my page! 😉
$contents = page contents
preg_match_all("/(.)(<div align=center>)(.)(<\/div>)(.*)/", $contents, $result_array, PREG_SET_ORDER);
$stuff_I_want = $result_array[0][3];
It works fine if everything's on one line, like so,...
<div align=center>stuff I want</div>
It doesn't work if the search covers multiple lines, like this,...
<div align=center>
stuff I want
</div>
Can preg_match_all() work over multiple lines?
Is so, how can I adjust my matching pattern?
Thanks, DC