note 46111 added to function.wordwrap
| From: | grey-greywyvern-com at osu1 dot php dot net | Date: | Wed, 29 Sep 2004 19:31:52 +0000 |
| Subject: | note 46111 added to function.wordwrap | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-77581@lists.php.net to get a copy of this message | ||
Here's an HTML wrapping + nl2br function I developed. It inserts line-breaks into long strings
of characters in HTML-formatted text while ignoring tags and entities. It also counts each entity
as a single character, and only applies nl2br to text nodes. You can also tell it to ignore whole
elements, like <pre> where adding <br /> isn't necessary.
Great for formatting HTML generated by user input. I distribute simple forum and blog scripts where
codes input by the user are translated to HTML. I send the result through this function to format
it correctly and make sure they don't maliciously type in long words in order to break my
layout.
http://www.greywyvern.com/code/php/htmlwrap_1.0.php.txt
----
Manual Page -- http://www.php.net/manual/en/function.wordwrap.php
Edit -- http://master.php.net/manage/user-notes.php?action=edit+46111
Delete -- http://master.php.net/manage/user-notes.php?action=delete+46111&report=yes
Reject -- http://master.php.net/manage/user-notes.php?action=reject+46111&report=yes
Search -- http://master.php.net/manage/user-notes.php