note 103638 added to function.nl2br
| From: | pgreviews at gmail dot com | Date: | Mon, 25 Apr 2011 19:07:16 +0000 |
| Subject: | note 103638 added to function.nl2br | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-179125@lists.php.net to get a copy of this message | ||
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!
----
Server IP: 69.147.83.197
Probable Submitter: 69.63.50.160
----
Manual Page -- http://www.php.net/manual/en/function.nl2br.php
Edit -- https://master.php.net/note/edit/103638
Del: integrated -- https://master.php.net/note/delete/103638/integrated
Del: useless -- https://master.php.net/note/delete/103638/useless
Del: bad code -- https://master.php.net/note/delete/103638/bad+code
Del: spam -- https://master.php.net/note/delete/103638/spam
Del: non-english -- https://master.php.net/note/delete/103638/non-english
Del: in docs -- https://master.php.net/note/delete/103638/in+docs
Del: other reasons-- https://master.php.net/note/delete/103638
Reject -- https://master.php.net/note/reject/103638
Search -- https://master.php.net/manage/user-notes.php