I've been struggling with this problem for two days:
How can I replace a string in a HTML document, when the string I'm supposed to replace includes a closing-HTML-tag?
For example:
if I want to replace a tag like: </ENDTAG> with something completely different, like </NEWENDTAG>, what is the correct syntax?
If I do it like this:
$string = "</NEWENDTAG>";
preg_replace("/</ENDTAG>/", $string, $htmlfile);
I get errors like unknown modifier 'E' or whatever.
I've tried to add backslashes around the slash in the tag, but then preg_replace doesn't find the wanted tag from the file..
Hope you get from this what I'm trying to say..
Thanks in advance.