手机
当前位置:查字典教程网 >编程开发 >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产生动态的影像图

PHP的伪随机数与真随机数详解

PHP入门速成(1)

我的论坛源代码(八)

随机广告显示(PHP函数)

支持中文的PHP按字符串长度分割成数组代码

php实现文本数据导入SQL SERVER

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

BBS(php & mysql)完整版(七)

精品推荐
分类导航