高亮度显示php源代码

2016-02-19 11:39 5 1 收藏

有一种朋友不在生活里,却在生命力;有一种陪伴不在身边,却在心间。图老师即在大家的生活中又在身边。这么贴心的服务你感受到了吗?话不多说下面就和大家分享高亮度显示php源代码吧。

【 tulaoshi.com - Web开发 】


高亮度显示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");
?

来源:https://www.tulaoshi.com/n/20160219/1598094.html

延伸阅读
标签: ASP
  从网上兴致冲冲地下载了ASP源代码,准备学习研究的时候.一打开文件,天书般的加密代码.很让人郁闷吧 :( 在网上是找到了解密的方法,得一个文件挨一个文件地打开,复制,粘贴,解密,再复制,再粘贴,再保存...... 如果一个ASP程序有几百个文件??? 解决办法来了.. decode.asp <% @Language="JavaScript" % <% /*  *-----------...
因为connection对象仅仅跟host对象相关,且处理一个套接字,所以其数据成员仅有:private Host _host; //指向宿主对象 private Socket _socket; //当前套接字我们知道host调用且仅了conn.ProcessOneRequest();方法,所以我们首先要找到此方法(coneetion很多方法,我们先看看主要的): public void ProcessOneRequest() { // wait for at leas...
标签: Web开发
这招算是目前网上公布的防止查看源代码的方法中最好的了,当然了,要看还是办法的,比如在地址栏中输入"javascript:alert(document.documentElement.outerHTML);"。 [Ctrl+A 全选 注:如需引入外部Js需刷新才能执行]
标签: ASP
  通过以上的代码即可显示表的结构,字段类型,长度,自动编号,主健。如果你仔细研究后就可以发现如何远程改变数据库的结构了,祝你好运! 要查看此演示,需要你建立一个数据源,request("table")改为你的表的名字。 <html <head <titlemain</title <meta http-equiv="Content-Type" content="...
标签: Web开发
AjaxTags项目是在现有的Struts HTML标记库的基础上,添加对AJAX支持。 AjaxTags改写了Struts标签类org.apache.struts.taglib.html.FormTag和org.apache.struts.taglib.html.BaseHandlerTag,并使用Struts的plugin技术,使得Struts提供了对AJAX的支持。 以下是jsp中简单的示例: html:form action="example1" ajaxRef="example1"> ...

经验教程

586

收藏

100
微博分享 QQ分享 QQ空间 手机页面 收藏网站 回到头部