note 102512 added to function.nl2br
[email protected] Fri, 18 Feb 2011 03:54:40 -0800
| Newsgroups | php.notes |
|---|---|
| Message-ID | <[email protected]> |
I noticed that I am using an earlier version of PHP which does not recognise the $xhtml parameter in nl2br(), therefore I am stuck with xhtml line breaks, which I do not want. Thus I made the following simple function:
<?php
function NlToBr($inString)
{
return preg_replace("%\n%", "<br>", $inString);
}
?>
----
Server IP: 92.48.74.199
Probable Submitter: 87.102.90.148
----
Manual Page -- http://www.php.net/manual/en/function.nl2br.php
Edit -- https://master.php.net/note/edit/102512
Del: integrated -- https://master.php.net/note/delete/102512/integrated
Del: useless -- https://master.php.net/note/delete/102512/useless
Del: bad code -- https://master.php.net/note/delete/102512/bad+code
Del: spam -- https://master.php.net/note/delete/102512/spam
Del: non-english -- https://master.php.net/note/delete/102512/non-english
Del: in docs -- https://master.php.net/note/delete/102512/in+docs
Del: other reasons-- https://master.php.net/note/delete/102512
Reject -- https://master.php.net/note/reject/102512
Search -- https://master.php.net/manage/user-notes.php