手机
当前位置:查字典教程网 >编程开发 >php教程 >高亮度显示php源代码
高亮度显示php源代码
摘要:高亮度显示php源代码

高亮度显示php源代码 <?php

function HeighPHPcode($Heightstring){

do{

$z=0;

if(preg_match('/<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("/<phpcode>(.*?)</phpcode>/s","$code",$Heightstring,1);

}

}while($z);

return $Heightstring;

}

##########################################################################################

#$PHPcode就是要被加亮的代码

$PHPcode= <<<END

<phpcode>

<?php

function HeighPHPcode($Heightstring){

do{

$z=0;

if(preg_match('/<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("/<phpcode>(.*?)</phpcode>/s","$code",$Heightstring,1);

}

}while($z);

return $Heightstring;

}

</phpcode>

END;

##########################################################################################

echo HeighPHPcode("$PHPcode");

?>

【高亮度显示php源代码】相关文章:

php实现文本数据导入SQL SERVER

用PHP产生动态的影像图

我的论坛源代码(八)

随机广告显示(PHP函数)

PHP应用分页显示制作详细讲解

我的论坛源代码(三)

PHP自动生成月历代码

php 批量查询搜狗sogou代码分享

php跨服务器访问方法小结

PHP分页显示制作详细讲解

精品推荐
分类导航