note 100781 added to function.htmlentities
| From: | Anonymous at osu1 dot php dot net | Date: | Fri, 05 Nov 2010 20:05:08 +0000 |
| Subject: | note 100781 added to function.htmlentities | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-173803@lists.php.net to get a copy of this message | ||
I wrote a class with methods to convert stray characters to entities as needed while preserving
existing entities as well as well formed html tags of your choice. It can pull out JavaScript from
the tags you allow (and I may soon enable pulling style attributes also). It can convert all 253 of
your named entities to numeric entities and visa versa. It also applies nl2br intelligently. It
cleans up whitespace and/or control characters to your liking, and can "hardspace" the
whitespace to retain the intended text-based layout format should you choose. It's my answer
to the dilemma of "does the person maintaining the content of the website know HTML?" and
I tried to balance the need for speed with requirement of XHTML validation.
It's become too long to post in these comments, but you can find the free PHP source code here:
http://softmoon-webware.com/PHP_functions-instructions.php#toXHTML
PEACE
----
Server IP: 69.147.83.197
Probable Submitter: 74.160.197.130
----
Manual Page -- http://www.php.net/manual/en/function.htmlentities.php
Edit -- https://master.php.net/note/edit/100781
Del: integrated -- https://master.php.net/note/delete/100781/integrated
Del: useless -- https://master.php.net/note/delete/100781/useless
Del: bad code -- https://master.php.net/note/delete/100781/bad+code
Del: spam -- https://master.php.net/note/delete/100781/spam
Del: non-english -- https://master.php.net/note/delete/100781/non-english
Del: in docs -- https://master.php.net/note/delete/100781/in+docs
Del: other reasons-- https://master.php.net/note/delete/100781
Reject -- https://master.php.net/note/reject/100781
Search -- https://master.php.net/manage/user-notes.php