How to replace text over multiple lines using preg_replace
If this weren't HTML, I'd tell you to use the DOTALL modifier to change the meaning of .
from 'match everything except new line' to 'match everything':
preg_replace('/(.*)<\/div>/s','abc',$body);
But this is HTML, so use an HTML parser instead.
it is the "s" flag, it enables . to capture newlines