This site is developed to XHTML and CSS2 W3C standards. If you see this paragraph, your browser does not support those standards and you need to upgrade. Visit WaSP for a variety of options.

Lampsig.org pastebin - Paste your PHP script, or other Code and link to it view php source

Posted by Greg Wed 15th Oct 14:20

001 
002 
003 
004 
005 
006 
007 
008 
009 
010 
011 
012 
013 
014 
015 
016 
017 
018 
019 
020 
021 
022 
023 
024 
025 
026 
027 
028 
<?php
//php syntax highlighter
   
class SyntaxHighlighter_php extends SyntaxHighlighter_none
   
{

       function 
highlight($php)
       {
           
//get php to do the hard work
           
ob_start();
           @
highlight_string($php);
           
$code ob_get_contents();
           
ob_end_clean();

           
// Hyperlink keywords - we could have a table or array or
           // interesting keywords, but that would be a bit laborious.
           // Instead, we just for things that look like function calls...
           // this has the downside that it links
           // user defined functions too, but what the hell. It's only
           // a few lines of code....

           
$keycol=ini_get("highlight.keyword");
           
$manual="http://www.php.net/manual-lookup.php?lang=en&amp;pattern=";

           
$code=preg_replace(
               
//match a highlighted keyword
               
'{([\w_]+)(\s*</font>)'.
               
//followed by a bracket
?>

The following amendments have been posted:

Submit a correction or amendment below. (click here to make a fresh posting)
Name

Please enter "ilikecode"

Remember my name in a cookie

Code: To ensure legibility, keep your code lines under 80 characters long.
Include comments to indicate what you need feedback on.
Page generated in 0.00336 seconds Lampsig.org