时时商务社区
标题:
高亮度显示php源代码
[打印本页]
作者:
xgnic
时间:
2018-2-14 09:46
高亮度显示php源代码
(.*?)/s',$Heightstring,$reg)) {
$z=1;
$code='';
ob_start();
highlight_string($reg[1]);
$code = ob_get_contents();
ob_end_clean();
$reg[1] = addslashes($reg[1]);
$Heightstring=preg_replace("/(.*?)/s","$code",$Heightstring,1);
}
}while($z);
return $Heightstring;
}
##########################################################################################
#$PHPcode就是要被加亮的代码
$PHPcode=
(.*?)/s',$Heightstring,$reg)) {
$z=1;
$code='';
ob_start();
highlight_string($reg[1]);
$code = ob_get_contents();
ob_end_clean();
$reg[1] = addslashes($reg[1]);
$Heightstring=preg_replace("/(.*?)/s","$code",$Heightstring,1);
}
}while($z);
return $Heightstring;
}
END;
##########################################################################################
echo HeighPHPcode("$PHPcode");
?>
您可能感兴趣的文章:
Discuz!5的PHP代码高亮显示插件(黑暗中的舞者更新)
推荐Discuz!5的PHP代码高亮显示与实现可运行代码
tinyMCE插件开发之插入html,php,sql,js代码 并代码高亮显示
php站内搜索并高亮显示关键字的实现代码
php 多关键字 高亮显示实现代码
PHP语法自动检查的Vim插件
php实现简单的语法高亮函数实例分析
欢迎光临 时时商务社区 (http://bbs.4435.cn/)
Powered by Discuz! X3.2