Adding a Syntax Highlighter (post a code snippet) to a Web Page

The SyntaxHighlighter is here to help you the developer/coder to post code snippets online with ease and have it look pretty on your website, home page, blog, CMS, or any other web page.  You can take a good look at how the SyntaxHighlighter works if you go to the site developed by Alex Gorbatchev, his website is dedicated to this subject.

From Alex Gorbatchev: “How does it work?  SyntaxHighlighter runs in the browser which means it doesn’t care what kind of server you have. In fact, SyntaxHighlighter can run locally on your computer without any web server at all and best of all it runs in virtually every modern web browser.”


<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "">
<html xmlns="" xml:lang="en" lang="en">
	<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
	<title>PHP Code Example</title>
	<h1>PHP Code Example</h1>

	<p><?php echo 'Hello World!'; ?></p>

	<p>This line is highlighted.</p>

	<div class="foobar">
		This	is	an
		example	of	smart

I prefer to use MODx, WordPress and Drupal for my web development, you can find 3rd party integration for each:

ModxPHP Syntax highlighter for MODx Revolution

DrupalSyntax Highlighter

WordPressSyntaxHighlighter Evolved

For a much larger list of 3rd party integration go to Alex Gorbatchev’s Integration Page

Hope this helps.