PHP Classes

PHP Syntax Highlighter: Highlight source code keywords with color

Recommend this page to a friend!
     
  Info   Example   View files Files   Install with Composer Install with Composer   Download Download   Reputation   Support forum   Blog    
Ratings Unique User Downloads Download Rankings
Not yet rated by the usersTotal: 150 All time: 9,086 This week: 673Up
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: 40
All time rank: 3597240 in India India
Week rank: 180 Up21 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 (3)  
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

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:150
This week:0
All time:9,086
This week:673Up