note 103638 deleted from function.nl2br by mazzanet
| From: | mazzanet@php.net | Date: | Tue, 26 Apr 2011 09:31:50 +0000 |
| Subject: | note 103638 deleted from function.nl2br by mazzanet | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-179139@lists.php.net to get a copy of this message | ||
Note Submitter: pgreviews at gmail dot com
----
Here is a function to turn br's into nl's. It uses somebody's regex I found on
another PHP note.
<?php
function br2nl($str) {
return preg_replace("/\s*<br[^>]*?>\s*/i","\n",$str);
}
?>
I hope it helps somebody!