PHP Classes

PHP Syntax Highlighter: Highlight source code keywords with color

Recommend this page to a friend!
  Info   View files Example   View files View files (3)   DownloadInstall with Composer Download .zip   Reputation   Support forum   Blog    
Ratings Unique User Downloads Download Rankings
Not yet rated by the usersTotal: 150 All time: 9,084 This week: 673Up
Version License PHP version Categories
syntax-highlighter 1.0.0Free for non-comm...5PHP 5, Tools, Text processing


This class can highlight source code keywords with color.

It can take source code of a given language and searches it for given keywords that have special meaning in that language.

The class highlights the keywords using HTML tags to mark them with certain colors.

The keywords and colors to highlight are configurable parameters.

Syntax highlighting is use to show different colors to be given to dozens of different lexical sub-elements of syntax.These include keywords, comments, control-flow statements, variables, and other elements.Programmers often customize their settings to show as much useful information as possible without making the code difficult to read.

Picture of Karthikeyan
  Performance   Level  
Name: Karthikeyan <contact>
Classes: 2 packages by
Country: India India
Age: 40
All time rank: 3589239 in India India
Week rank: 259 Up16 in India India Up


$obj = new highlighter();
$fileContent = trim(file_get_contents("highlighter.php", true));
$fileContent = htmlentities($fileContent);

  Files folder image Files  
File Role Description
Plain text file highlighter.php Class Syntax Highlighter File
Accessible without login Plain text file keywords.php Conf. Configuration File
Accessible without login Plain text file index.php Example Sample File

 Version Control Unique User Downloads Download Rankings  
This week:0
All time:9,084
This week:673Up