Re: note 101642 added to function.nl2br
| From: | Daniel Brown | Date: | Fri, 31 Dec 2010 15:35:53 +0000 |
| Subject: | Re: note 101642 added to function.nl2br | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-175372@lists.php.net to get a copy of this message | ||
On Fri, Dec 31, 2010 at 10:29, <a.e@inne.pl> wrote:
> The most important note is missing that nl2br does not remove \n character.
>
> It replaces \n with <br />\n
>
> <?php
> $x = "A\nB";
> $y = nl2br( nl2br( $x ) );
>
> // produces "A<br /><br />\nB"
> ?>
>
> In addition \r is not removed/replaced either.
> ----
> Server IP: 69.147.83.197
> Probable Submitter: 89.167.220.4
No, it's not missing, it says it right in the function description:
"Inserts HTML line breaks before all newlines in a string"
If it doesn't indicate the same in the Polish translation
(presuming that's what version you were reading), submit that as a
documentation bug (http://bugs.php.net/), because it should.
Thanks.
--
</Daniel P. Brown>
Network Infrastructure Manager
Documentation, Webmaster Teams
http://www.php.net/