I am trying to use preg_replace to convert <br>
or <br />
to a carriage return ( )
. My problem seems to be that it either doesn't find the <br>
's or doesn't recognize the hex code I'm trying to pass in. Here is my relevant PHP:
preg_replace('`<br(?: /)?>(\x{13}/u)`', '$1', $content);
Other Information: The strings I am passing in have "
but I don't think that will interfere with preg_replace()
.
Here are a couple links that have helped me get this far:
http://www.webmasterworld.com/forum21/10973.htm (use carriage return instead of \n
in tooltips)
http://us2.php.net/manual/en/reference.pcre.pattern.modifiers.php#58409 (use \x{13}
instead of 
)
`'s! The ` ` doesn't seem to be creating a carriage return in my tooltip but that's not a PHP question. – Kevin Jul 07 '11 at 23:12
or weird things like that. and if your
is missing the closing tag (>) it will replace EVERYTHING up to the next closing tag it happens to find. – Ben Jul 07 '11 at 23:18