A few notes:
1. You must tell blogger to not convert your line breaks. If you don't it'll screw up the PHP code.
2. You must have your blogger set to create an index.php or the like.
3. Change the 'php' below to the proper language based on what you're posting.
Code Example © Robert Mech. May be used freely as long as credit is given to the source.
<?php
include_once('geshi/geshi.php');
$source = <<<END
// SOURCE CODE HERE
END;
$geshi = new GeSHi($source, 'php');
$geshi->set_header_type(GESHI_HEADER_DIV);
echo $geshi->parse_code();
?>
If you use this code, please make a comment on the blog!
No comments:
Post a Comment