note 60319 added to function.nl2br
| From: | foltscane at yahoo dot com | Date: | Tue, 03 Jan 2006 16:47:37 +0000 |
| Subject: | note 60319 added to function.nl2br | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-101154@lists.php.net to get a copy of this message | ||
I was interested in changing \n to <BR> but then still having htmlentities enforced inbetween
these added <BR>s. So I wrote this simple textentities which will do just that.
function textentities($s)
{
while($sp = strpos($s,"\n"))
{
echo htmlentities(substr($s,0,$sp))."<BR>";
$s = substr($s,$sp+1,strlen($s));
}
echo htmlentities($s);
}
----
Manual Page -- http://www.php.net/manual/en/function.nl2br.php
Edit -- http://master.php.net/manage/user-notes.php?action=edit+60319
Delete: added to the manual -- http://master.php.net/manage/user-notes.php?action=delete+60319&report=yes&reason=added+to+the+manual
Delete: bad code -- http://master.php.net/manage/user-notes.php?action=delete+60319&report=yes&reason=bad+code
Delete: spam -- http://master.php.net/manage/user-notes.php?action=delete+60319&report=yes&reason=spam
Delete: useless -- http://master.php.net/manage/user-notes.php?action=delete+60319&report=yes&reason=useless
Delete: non-english -- http://master.php.net/manage/user-notes.php?action=delete+60319&report=yes&reason=non-english
Delete: already in docs -- http://master.php.net/manage/user-notes.php?action=delete+60319&report=yes&reason=already+in+docs
Delete: other reasons -- http://master.php.net/manage/user-notes.php?action=delete+60319&report=yes
Reject -- http://master.php.net/manage/user-notes.php?action=reject+60319&report=yes
Search -- http://master.php.net/manage/user-notes.php