Page 1 of 1

PHP Colorizator

Posted: Mon Mar 27, 2006 10:46 am
by argyle
Is there any way to get the source for the markup engine for the "php" tags? I'd like to generate the same markup for some of my code. Something akin to:

Code: Select all

// Comment

function thisFunction($params){
$variableName = new Variable($params);

for ($c = 0; $c < 10; $c++) {

echo "Some string";

}

return 10;

}
Basically, some php code to automatically do what I did above.

- jake

Posted: Mon Mar 27, 2006 10:47 am
by Chris Corbyn
http://php.net/highlight_file
http://php.net/highlight_string

;)

EDIT | I assume you meant highlighting? Upon re-reading your post I'm not so sure now.

Posted: Mon Mar 27, 2006 10:50 am
by argyle
Haha, thanks, I was just starting to write the regex to do this...

Boy, those guys at php.net are taking all the fun out of being a CS major.. :wink: