I have a block of text that looks like this:
... a bunch of stuff
I\'d like to remov
These days I am using the /s
modifier to do this. I noticed no one mentioned that. I use markup with is free of spaces too like
{bof-nf}
... a bunch of stuff
{eof-nf}
So for example, to remove this block, use
$newcontent = preg_replace("/\{bof-nf\}(.*)\{eof-nf\}\\n/s", "", $newcontent);
To keep the block but remove the tags, use
$newcontent = preg_replace("/\{bof-nf\}.*\\n/", "", $newcontent);
$newcontent = preg_replace("/\{eof-nf\}.*\\n/", "", $newcontent);