prettyrhythmdearmyfuturephp公用函数列表[正则]
内容导读
收集整理的这篇技术教程文章主要介绍了prettyrhythmdearmyfuturephp公用函数列表[正则],小编现在分享给大家,供广大互联网技能从业者学习和参考。文章包含3382字,纯文字阅读大概需要5分钟。
内容图文
代码如下:
/*********************************************************************
* 公用函数列表
* ubb,getip,GoIn,goback,IsInt,InString
* OurHome:http://iwind.org
* http://10.13.31.90/~coldwind
*
* */
/////////////////ubb支持代码函数////////////////////////////
function ubb($Text) {
$Text=trim($Text);
$Text=htmlspecialchars($Text);
$Text=ereg_replace("n","
",$Text);
$Text=preg_replace("/\t/is"," ",$Text);
$Text=preg_replace("/[h1](.+?)[/h1]/is","
https://www.gxlcms.com/1
",$Text);$Text=preg_replace("/[h2](.+?)[/h2]/is","
https://www.gxlcms.com/1
",$Text);$Text=preg_replace("/[h3](.+?)[/h3]/is","
https://www.gxlcms.com/1
",$Text);$Text=preg_replace("/[h4](.+?)[/h4]/is","
https://www.gxlcms.com/1
",$Text);$Text=preg_replace("/[h5](.+?)[/h5]/is","
https://www.gxlcms.com/1
",$Text);$Text=preg_replace("/[h6](.+?)[/h6]/is","
https://www.gxlcms.com/1
",$Text);$Text=preg_replace("/[center](.+?)[/center]/is","
$Text=preg_replace("/[url](http://.+?)[/url]/is","https://www.gxlcms.com/1",$Text);
$Text=preg_replace("/[url](.+?)[/url]/is","http://https://www.gxlcms.com/1",$Text);
$Text=preg_replace("/[url=(http://.+?)](.*)[/url]/is","\2",$Text);
$Text=preg_replace("/[url=(.+?)](.*)[/url]/is","\2",$Text);
$Text=preg_replace("/[img](.+?)[/img]/is","",$Text);
$Text=preg_replace("/[color=(.+?)](.+?)[/color]/is","\2",$Text);
$Text=preg_replace("/[size=(.+?)](.+?)[/size]/is","\2",$Text);
$Text=preg_replace("/[sup](.+?)[/sup]/is","https://www.gxlcms.com/1",$Text);
$Text=preg_replace("/[sub](.+?)[/sub]/is","https://www.gxlcms.com/1",$Text);
$Text=preg_replace("/[pre](.+?)[/pre]/is","
https://www.gxlcms.com/1",$Text);
$Text=preg_replace("/[email](.+?)[/email]/is","https://www.gxlcms.com/1",$Text);
$Text=preg_replace("/[i](.+?)[/i]/is","https://www.gxlcms.com/1",$Text);
$Text=preg_replace("/[b](.+?)[/b]/is","https://www.gxlcms.com/1",$Text);
$Text=preg_replace("/[quote](.+?)[/quote]/is","
quote:", $Text);
https://www.gxlcms.com/1
$Text=preg_replace("/[code](.+?)[/code]/is","
code:", $Text);
https://www.gxlcms.com/1
$Text=preg_replace("/[sig](.+?)[/sig]/is","
--------------------------
https://www.gxlcms.com/1
--------------------------", $Text);
return $Text;
}
////////////////取得浏览者的ip地址/////////////////////////////
function getip() {
$IP=getenv('REMOTE_ADDR');
$IP_ = getenv('HTTP_X_FORWARDED_FOR');
if (($IP_ != "") && ($IP_ != "unknown")) $IP=$IP_;
return $IP;
}
function goback($num,$saying){
echo"
$saying"; } ///////////////////判断字符串中是否含有array中的某一值///////////////// function InString($array,$string){ while(list(,$value)=each($array)){ if(eregi($value,$string)){ return true; exit; } } } ////////////////////链接到某一页面/////////////////////////////////////// function GoIn($addr,$saying){ echo"
} ////////////////////JS返回////////////////////////////////////////////// function IsInt($string){ if(ereg("^[0-9]{0,}$",$string)){ return true; } else { return false; } } ?> 以上就介绍了pretty rhythm dear my future php公用函数列表[正则],包括了pretty rhythm dear my future方面的内容,希望对PHP教程有兴趣的朋友有所帮助。 内容总结
内容备注
希望以上内容对你有所帮助!如果还有其他问题,请随时提问。 各类知识收集 拥有多年CMS企业建站经验,对 lecms, classcms, fastadmin, pbootcms, phpcms, eyoucms, yzmcms, PHP, xunruicms, jizhicms, dedecms, wordpress, hkcms, yzncms, 等各类cms的相互转化,程序开发,网站制作,bug修复,程序杀毒,插件定制都可以提供最佳解决方案。 未经允许不得转载:Str Tom工作室 » prettyrhythmdearmyfuturephp公用函数列表[正则]
相关推荐
|