/*********************************************************************
* 公用函数列表
* 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","
\\1",$Text);
$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:
\\1
", $Text);
$Text=preg_replace("/\[code\](.+?)\[\/code\]/is","
code:
\\1
", $Text);
$Text=preg_replace("/\[sig\](.+?)\[\/sig\]/is","
--------------------------
\\1
--------------------------
", $Text);
return $Text;
}
////////////////訪問者の IP アドレスを取得//////////// / ////////////////
function getip() {
$IP=getenv('REMOTE_ADDR')
$IP_ = getenv('HTTP_X_FORWARDED_FOR'); != "") && ($IP_ != "unknown")) $IP=$IP_;
$IP を返す
}
function goback($num,$saying){
echo"
$saying";
}
///////// / /////////文字列に配列内の特定の値が含まれているかどうかを判断します//////////////////
function InString($array,$string){
while (list(,$value)=each($array)){
if(eregi($value,$string)){
return true
}
}
}
////// // ////////////ページへのリンク//////////////////////////////// / ///////
function GoIn($addr,$saying){
echo"";
}
/////////////////////JS return/ //////////////////////////////////////////////
関数 IsInt ($ string){
if(ereg("^[0-9]{0,}$",$string)){
true を返す
}
else {
return false
}
}
?>
http://www.bkjia.com/PHPjc/317885.html
www.bkjia.comtruehttp://www.bkjia.com/PHPjc/317885.html技術記事次のようにコードをコピーします: ?php /***************************************** * *************************** *パブリック関数のリスト*ubb,getip,GoIn,goback,IsInt,InString *OurHome:http: // いわ...
このウェブサイトの声明
この記事の内容はネチズンが自主的に寄稿したものであり、著作権は原著者に帰属します。このサイトは、それに相当する法的責任を負いません。盗作または侵害の疑いのあるコンテンツを見つけた場合は、admin@php.cn までご連絡ください。
著者別の最新記事
-
2024-10-22 09:46:29
-
2024-10-13 13:53:41
-
2024-10-12 12:15:51
-
2024-10-11 22:47:31
-
2024-10-11 19:36:51
-
2024-10-11 15:50:41
-
2024-10-11 15:07:41
-
2024-10-11 14:21:21
-
2024-10-11 12:59:11
-
2024-10-11 12:17:31