PHP Classes
elePHPant
Icontem

Regulate XHTML Text: Encode characters in text in HTML tags

Recommend this page to a friend!
  Info   View files View files (11)   DownloadInstall with Composer Download .zip   Reputation   Support forum   Blog    
Last Updated Ratings Unique User Downloads Download Rankings
2011-06-17 (5 years ago) RSS 2.0 feedNot yet rated by the usersTotal: 428 All time: 6,007 This week: 1,069Up
Version License PHP version Categories
xhtmlencode 1.0GNU General Publi...5.0HTML, PHP 5, Text processing, Security
Description Author

This class can encode characters in text in HTML tags.

It can take a text string eventual formatted with HTML tags and encodes all characters as HTML entities, preserving the original HTML markup.

The class can also replace line break characters by line break HTML tags if the line break is within an HTML tag.

It can also remove any JavaScript it finds to prevent cross-site scripting attacks.

Innovation Award
PHP Programming Innovation award nominee
July 2011
Number 6
Cleaning up and encoding text to show it in HTML pages is easy. However, if you need to properly encode text that is already within HTML tags, it is not so easy.

This class provides a solution that parses the HTML and rewrite the tags and data to properly encode all the text it contains.

Manuel Lemos
Picture of Joseph
Name: Joseph <contact>
Classes: 3 packages by
Country: United States United States
Innovation award
Innovation award
Nominee: 2x

  Files folder image Files  
File Role Description
Plain text file PHP_functions.php Class Source code for XHTML encode
Accessible without login HTML file PHP_functions-php_sourcecode.htm Data Source Code (highlighted) for XHTMLencode (and more)
Accessible without login Plain text file test_XHTMLencode.php Example Demo of Regulate Text Class (XHTMLencode)
Accessible without login HTML file test_XHTMLencode-php_sourcecode.htm Data Sourcecode of Demo for Regulate Text Class (XHTMLencode)
Accessible without login Plain text file PHP_functions-instructions.php Aux. How to use the RegulateText Class (XHTMLencode) and others
Accessible without login HTML file test_array_subkey-php_sourcecode.htm Data Sourcecode of Bonus Demo: array_subkey for PHP 5.3
Accessible without login HTML file test_array_subkey.php Example Demo of bonus: array_subkey for PHP 5.3
Accessible without login Image file SoftMoon.gif Icon foreground image
Accessible without login Image file SoftMoon.repeat-x.png Icon backgrournd image
Accessible without login Image file SoftMoon.repeat-y.png Icon background image
Accessible without login Image file SoftMoon.footer.back.png Icon background image

 Version Control Unique User Downloads Download Rankings  
 0%
Total:428
This week:0
All time:6,007
This week:1,069Up