Forum Moderators: coopster
$replacement = '$1$2$3' . "<br>" ;
echo preg_replace("/(<\/)([^>]*)(>)/s",$replacement,$xml_string);
It seems to be working for some of the closing tags, but for others not.Why is that?
Thanks.
[edited by: eelixduppy at 12:50 am (utc) on Nov. 18, 2009]
[edit reason] disabled smileys [/edit]
$replacement = '$1' . "<br>" ;
echo preg_replace("#(</[^>]*>)#m",$replacement,$xml_string);
The biggest change I made is to the modifier, which makes it multiline (I'm actually not sure if you need it, but there's nothing to test with, and it shouldn't hurt).
Also, I'm not sure if you are needing to match the html values of the tags, but I made the expression a little more readable using the actual characters, as well as eliminated the unnecessary back-references.
If this does not work and you need some more help, please post a portion of the string (examplified if necessary) including line breaks and a few tags, so there is something to test with.