Login   Register  
PHP Classes
elePHPant
Icontem

Regulate XHTML Text: Encode characters in text in HTML tags

Recommend this page to a friend!
Stumble It! Stumble It! Bookmark in del.icio.us Bookmark in del.icio.us
  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 (3 years ago) RSS 2.0 feedNot yet rated by the usersTotal: 419 This week: 1All time: 5,736 This week: 1,467Up
Version License PHP version Categories  
xhtmlencode 1.0GNU General Public Lice...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
Age: ???
All time rank: 2488308 in United States United States
Week rank: 789 Up77 in United States United States Up
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:419All time:5,736
 This week:1This week:1,467Up