ホームページ  >  記事  >  バックエンド開発  >  PHPソースコードのハイライト表示_PHPチュートリアル

PHPソースコードのハイライト表示_PHPチュートリアル

WBOY
WBOYオリジナル
2016-07-21 16:08:30824ブラウズ


高光度显表示php源代码 function HeighPHPcode($Heightstring){
do{
$z=0;
if(preg_match('/(.*?)/s',$Heightstring,$reg)) {
$z=1;
$code='';
ob_start();
highlight_string($reg[1]);
$code = ob_get_contents();
ob_end_clean();
$reg[1] = addlashes($reg[1]);
$Heightstring=preg_replace("/(.*?)/s","$code",$Heightstring,1);
}
}while($z);
$Heightstring を返します;
}
############################################# ###########################################
#$PHPcode は被るべきものです加亮的代码
$PHPcode= <<
function HeighPHPcode($Heightstring){
do{
$z=0;
if(preg_match('/(.*?)/s',$Heightstring,$reg)) {
$z=1;
$code='';
ob_start();
highlight_string($reg[1]);
$code = ob_get_contents();
ob_end_clean();
$reg[1] = addlashes($reg[1]);
$Heightstring=preg_replace("/(.*?)/s","$code",$Heightstring,1);
}
}while($z);
$Heightstring を返します;
}

END;
##################################### ################################################ ##
echo HeighPHPcode("$PHPcode");
?>

www.bkjia.comtru​​ehttp://www.bkjia.com/PHPjc/314804.html技術記事高光度显示php源代?php function HeighPHPcode($Heightstring){ do{ $z=0; if(preg_match('/phpcode(.*?)/phpcode/s',$Heightstring,$reg)) { $z=1; $コード=''; ob_start();やあ…
声明:
この記事の内容はネチズンが自主的に寄稿したものであり、著作権は原著者に帰属します。このサイトは、それに相当する法的責任を負いません。盗作または侵害の疑いのあるコンテンツを見つけた場合は、admin@php.cn までご連絡ください。