Home

zhangyiqun

Thoughts, stories and ideas.

翻译 2014年以前 About Feed

14 Jul 2010
PHP使用GeSHi实现代码高亮

<?php

require ‘/opt/lampp/htdocs/jqbox/geshi/geshi.php’;

$geshi = new Geshi($code, ‘javascript’);

$geshi->enable_line_numbers(GESHI_FANCY_LINE_NUMBERS);

echo  $geshi->parse_code();

?>

使用起来还是比较简单的,类封装的不错。官方文档在此:http://qbnz.com/highlighter/geshi-doc.html#the-basics

Wechat:) HelloZhangyiqun

翻译 2014年以前 About Feed