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: 149 All time: 9,081 This week: 148Up
Version License PHP version Categories
syntax-highlighter 1.0.0Free for non-comm...5PHP 5, Tools, Text processing
Description 

Author

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: 39
All time rank: 3584238 in India India
Week rank: 312 Up22 in India India Up

Example

<?php
include_once("highlighter.php");
$obj = new highlighter();
$fileContent = trim(file_get_contents("highlighter.php", true));
$fileContent = htmlentities($fileContent);
echo
$obj->applycolor($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  
 0%
Total:149
This week:0
All time:9,081
This week:148Up