pretty rhythm dear my future php公用函数列表[正则]

php中文网
发布: 2016-07-29 08:36:27
原创
1171人浏览过

复制代码 代码如下:


/*********************************************************************
* 公用函数列表
* 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(" ","
",$Text); 
  $Text=preg_replace("/ /is","  ",$Text); 
  $Text=preg_replace("/[h1](.+?)[/h1]/is","

序列猴子开放平台
序列猴子开放平台

具有长序列、多模态、单模型、大数据等特点的超大规模语言模型

序列猴子开放平台 0
查看详情 序列猴子开放平台

\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","pretty rhythm dear my future php公用函数列表[正则]",$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'); 
   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"
$saying
";
}
////////////////////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教程有兴趣的朋友有所帮助。

PHP速学教程(入门到精通)
PHP速学教程(入门到精通)

PHP怎么学习?PHP怎么入门?PHP在哪学?PHP怎么学才快?不用担心,这里为大家提供了PHP速学教程(入门到精通),有需要的小伙伴保存下载就能学习啦!

下载
来源:php中文网
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系admin@php.cn
最新问题
开源免费商场系统广告
热门教程
更多>
最新下载
更多>
网站特效
网站源码
网站素材
前端模板
关于我们 免责申明 举报中心 意见反馈 讲师合作 广告合作 最新更新 English
php中文网:公益在线php培训,帮助PHP学习者快速成长!
关注服务号 技术交流群
PHP中文网订阅号
每天精选资源文章推送
PHP中文网APP
随时随地碎片化学习

Copyright 2014-2025 https://www.php.cn/ All Rights Reserved | php.cn | 湘ICP备2023035733号