note 86678 added to function.nl2br
| From: | N/A at osu1 dot php dot net | Date: | Wed, 29 Oct 2008 15:41:41 +0000 |
| Subject: | note 86678 added to function.nl2br | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-145929@lists.php.net to get a copy of this message | ||
Here's a more simple one:
<?php
/**
* Convert BR tags to nl
*
* @param string The string to convert
* @return string The converted string
*/
function br2nl($string)
{
return preg_replace('/\<br(\s*)?\/?\>/i', "\n", $string);
}
?>
Enjoy
----
Server IP: 195.207.10.20
Probable Submitter: 213.49.226.228
----
Manual Page -- http://www.php.net/manual/en/function.nl2br.php
Edit -- https://master.php.net/note/edit/86678
Del: integrated -- https://master.php.net/note/delete/86678/integrated
Del: useless -- https://master.php.net/note/delete/86678/useless
Del: bad code -- https://master.php.net/note/delete/86678/bad+code
Del: spam -- https://master.php.net/note/delete/86678/spam
Del: non-english -- https://master.php.net/note/delete/86678/non-english
Del: in docs -- https://master.php.net/note/delete/86678/in+docs
Del: other reasons-- https://master.php.net/note/delete/86678
Reject -- https://master.php.net/note/reject/86678
Search -- https://master.php.net/manage/user-notes.php