I'm working with a prebuilt javascript WYSIWYG editor, and it automatically adds line breaks and paragraph tags where it thinks they're needed. How ever, it's adding stuff where it shouldn't be! One particular place is causing a problem...
I have:
<!-- Start: Content Container -->
<div id="container_content">
But the editor turns it in to:
<!-- Start: Content Container -->
<p> </p>
<div id="container_content">
So I want to basically erase any data in the middle of those two tags with PHP. I could "rig" it with some explodes and piece it back together...but is there an easier way with preg_replace or regex or something?
------------------- Edit -------------------
I've tried:
$body = preg_replace_callback("/<!-- Start: Content Container -->(.*?)<div id=\"container_content\">}/is", returnNothing, $body);
function returnNothing() {
return "";
}
but it's not working as expected?