PHP Classes

PHP color: Format PHP code as colored HTML

Recommend this page to a friend!
  Info   Screenshots Screenshots   View files View files (2)   DownloadInstall with Composer Download .zip   Reputation   Support forum (3)   Blog    
Ratings Unique User Downloads Download Rankings
StarStarStar 55%Total: 862 This week: 1All time: 4,061 This week: 560Up
Version License PHP version Categories
phpcolor 1.0Freeware5.0HTML, PHP 5, Text processing
Description 

Author

This class can be used to format PHP code as colored HTML independent of the PHP code version.

It takes a string of PHP code and reformats it by adding HTML tags that can render the PHP constructs using different colors.

The PHP code text reformatting uses only regular expression replacement.

Innovation Award
PHP Programming Innovation award nominee
August 2008
Number 2


Prize: One book of choice from Manning
PHP provides built-in support to display PHP code with highlighted syntax.

However, if you want to highlight code for PHP 5 or later using PHP 4, it may not work, as the highlighting functions may fail because PHP 5 syntax is invalid under PHP 4.

This class provides an alternative solution based on replacing code with syntax highlighting tags using PHP version independent regular expressions.

Manuel Lemos
Picture of hazem ali
Name: hazem ali <contact>
Classes: 1 package by
Country: Egypt Egypt
Age: 39
All time rank: 255925 in Egypt Egypt
Week rank: 411 Up6 in Egypt Egypt Up
Innovation award
Innovation award
Nominee: 1x

Screenshots  
  • screenshot
  Files folder image Files  
File Role Description
Accessible without login Plain text file example.php Example test
Plain text file phpcolor.php Class class source

 Version Control Unique User Downloads Download Rankings  
 0%
Total:862
This week:1
All time:4,061
This week:560Up
User Ratings User Comments (2)
 All time
Utility:79%StarStarStarStar
Consistency:75%StarStarStarStar
Documentation:-
Examples:83%StarStarStarStarStar
Tests:-
Videos:-
Overall:55%StarStarStar
Rank:1934
 
Overall, it's sufficient.
15 years ago (Tim White)
52%StarStarStar
Very nice idea, already saw something of this type on perl bu...
15 years ago (David Ferreira)
67%StarStarStarStar