pretty rhythm dear my future php公用函数列表[正则]
/*********************************************************************
* 公用函数列表
* 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","
\\1
",$Text);$Text=preg_replace("/\[h2\](.+?)\[\/h2\]/is","
\\1
",$Text);$Text=preg_replace("/\[h3\](.+?)\[\/h3\]/is","
\\1
",$Text);$Text=preg_replace("/\[h4\](.+?)\[\/h4\]/is","
\\1
",$Text);$Text=preg_replace("/\[h5\](.+?)\[\/h5\]/is","
\\1
",$Text);$Text=preg_replace("/\[h6\](.+?)\[\/h6\]/is","
\\1
",$Text);$Text=preg_replace("/\[center\](.+?)\[\/center\]/is","
$Text=preg_replace("/\[url\](http:\/\/.+?)\[\/url\]/is","\\1",$Text);
$Text=preg_replace("/\[url\](.+?)\[\/url\]/is","http://\\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","\\1",$Text);
$Text=preg_replace("/\[sub\](.+?)\[\/sub\]/is","\\1",$Text);
$Text=preg_replace("/\[pre\](.+?)\[\/pre\]/is","
\\1",$Text);
$Text=preg_replace("/\[email\](.+?)\[\/email\]/is","\\1",$Text);
$Text=preg_replace("/\[i\](.+?)\[\/i\]/is","\\1",$Text);
$Text=preg_replace("/\[b\](.+?)\[\/b\]/is","\\1",$Text);
$Text=preg_replace("/\[quote\](.+?)\[\/quote\]/is","
quote:", $Text);
\\1
$Text=preg_replace("/\[code\](.+?)\[\/code\]/is","
code:", $Text);
\\1
$Text=preg_replace("/\[sig\](.+?)\[\/sig\]/is","
--------------------------
\\1
--------------------------
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教程有兴趣的朋友有所帮助。 声明:本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系admin@php.cn核实处理。 相关文章 相关视频
专题推荐
|
推荐阅读
-
pretty rhythm dear my future PHP 编写的 25个游戏脚本
-
pretty rhythm dear my future PHP 第三节 变量介绍
-
pretty rhythm dear my future PHP 引用文件技巧
-
pretty rhythm dear my future PHP 引用文件技巧
-
pretty rhythm dear my future php去除重复字的实现代码
-
pretty rhythm dear my future PHP 编写的 25个游戏脚本
-
pretty rhythm dear my future php的正则处理函数总结分析
-
pretty rhythm dear my future php去除重复字的实现代码
-
pretty rhythm dear my future php公用函数列表[正则]
-
pretty rhythm dear my future PHP 作用域解析运算符::
网友评论
文明上网理性发言,请遵守 新闻评论服务协议
我要评论