PHP Classes

PHP color: Format PHP code as colored HTML

Recommend this page to a friend!
  Info   Screenshots   View files Files   Install with Composer Install with Composer   Download Download   Reputation   Support forum   Blog    
Ratings Unique User Downloads Download Rankings
StarStarStar 55%Total: 862 All time: 4,062 This week: 206Up
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: 40
All time rank: 256025 in Egypt Egypt
Week rank: 278 Up6 in Egypt Egypt Up
Innovation award
Innovation award
Nominee: 1x

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

The PHP Classes site has supported package installation using the Composer tool since 2013, as you may verify by reading this instructions page.
Install with Composer Install with Composer
 Version Control Unique User Downloads Download Rankings  
 0%
Total:862
This week:0
All time:4,062
This week:206Up
User Ratings User Comments (2)
 All time
Utility:79%StarStarStarStar
Consistency:75%StarStarStarStar
Documentation:-
Examples:83%StarStarStarStarStar
Tests:-
Videos:-
Overall:55%StarStarStar
Rank:1974
 
Overall, it's sufficient.
16 years ago (Tim White)
52%StarStarStar
Very nice idea, already saw something of this type on perl bu...
16 years ago (David Ferreira)
67%StarStarStarStar