Thanks for solving that problem.
I only needed to escape the quotations inside the regexp expression to get it to work ..
/(<div id=\"footer\")(.+?)(<\/div>)/s
I have a related question ..
what is the opposite of preg_replace?
i.e. to include (non-cull) only the HTML code between string1 and string2
I am trying this ....
preg_match_all( "/(<div id=\"footer\")(.+?)(<\/div>)/s ", $htmlfile, $out, preg_pattern_order);
but I get this error ..
Warning: preg_match_all() expects parameter 4 to be long, string given in
Note: For others learning regexp, this utility is very useful
The Regex Coach
Thanks again.