note 41297 deleted from function.nl2br by googleguy
| From: | googleguy@php.net | Date: | Thu, 13 Jun 2013 11:01:16 +0000 |
| Subject: | note 41297 deleted from function.nl2br by googleguy | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-195147@lists.php.net to get a copy of this message | ||
Note Submitter: php at sharpdreams dot com
----
Better br2nl function (allows for non-valid XHTML tags). I find it useful for parsing 3rd party
websites to convert their screwy BR formats to \n.
<?php
function br2nl( $data ) {
return preg_replace( '!<br.*>!iU', "\n", $data );
}
?>