I'm having a really weird problem with preg_replace here (and as far as I can remember, this isn't the first time I've seen this). I have an XML with an element with invalid structure (closing tag is missing the slash, breaks parser): I'm having a really weird problem with preg_rep