note 41297 added to function.nl2br
| From: | php at sharpdreams dot com | Date: | Tue, 06 Apr 2004 01:52:29 +0000 |
| Subject: | note 41297 added to function.nl2br | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-67678@lists.php.net to get a copy of this message | ||
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 );
}
?>
----
Manual Page -- http://www.php.net/manual/en/function.nl2br.php
Edit -- http://master.php.net/manage/user-notes.php?action=edit+41297
Delete -- http://master.php.net/manage/user-notes.php?action=delete+41297&report=yes
Reject -- http://master.php.net/manage/user-notes.php?action=reject+41297&report=yes
Search -- http://master.php.net/manage/user-notes.php