pretty dear rhythm my future php public function list [regular]

WBOY
Release: 2016-07-29 08:36:27
Original
916 people have browsed it

复制代码 代码如下:


/*********************************************************************
* 公用函数列表
* 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;
}
/////////////////Get the visitor’s ip address////////////// ////////////////
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";
}
/////////// /////////Determine whether the string contains a certain value in array//////////////////
function InString($array,$string){
while(list(,$value)=each($array)){
if(eregi($value,$string)){
return true;
exit;
}
}
}
/////// /////////////Link to a page/////////////////////////////////// ///////
function GoIn($addr,$saying){
echo"
$saying
";
}
/////////////////////JS return// //////////////////////////////////////////////
function IsInt($string ){
if(ereg("^[0-9]{0,}$",$string)){
return true;
}
else {
return false;
}
}
?>

The above introduces the pretty rhythm dear my future PHP public function list [regular], including the content of pretty rhythm dear my future. I hope it will be helpful to friends who are interested in PHP tutorials.

Related labels:
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template