高亮度显示php源代码

高亮度显示php源代码

2004-10-7 18:25:00来源:本站整理作者:蓝点人气:127我要评论(0)

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] = addslashes($reg[1]);
     $Heightstring=preg_replace("/ (.*?)/s","$code",$Heightstring,1);
    }
}while($z);
return $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] = addslashes($reg[1]);
     $Heightstring=preg_replace("/ (.*?)/s","$code",$Heightstring,1);
    }
}while($z);
return $Heightstring;
}

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

阅读本文后您有什么感想? 已有 人给出评价!

  • 0 囧
      囧
  • 0 恶心
      恶心
  • 0 期待
      期待
  • 0
      难过
  • 0 不错
      不错
  • 0 关注
      关注
  • 最新评论
  • 热门评论
共有评论(0)条 查看全部评论
高兴 可 汗 我不要 害羞 好 下下下 送花 屎 亲亲

注:您的评论需要经过审核才会显示出来