木瓜图片,日语自学网,就业培训
<?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","<br>",$text);
$text=preg_replace("/\\t/is"," ",$text);
$text=preg_replace("/\[h1\](.+?)\[\/h1\]/is","<h1>\\1</h1>",$text);
$text=preg_replace("/\[h2\](.+?)\[\/h2\]/is","<h2>\\1</h2>",$text);
$text=preg_replace("/\[h3\](.+?)\[\/h3\]/is","<h3>\\1</h3>",$text);
$text=preg_replace("/\[h4\](.+?)\[\/h4\]/is","<h4>\\1</h4>",$text);
$text=preg_replace("/\[h5\](.+?)\[\/h5\]/is","<h5>\\1</h5>",$text);
$text=preg_replace("/\[h6\](.+?)\[\/h6\]/is","<h6>\\1</h6>",$text);
$text=preg_replace("/\[center\](.+?)\[\/center\]/is","<center>\\1</center>",$text);
$text=preg_replace("/\[url\](http:\/\/.+?)\[\/url\]/is","<a href=\\1>\\1</a>",$text);
$text=preg_replace("/\[url\](.+?)\[\/url\]/is","<a href=\"http://\\1\">http://\\1</a>",$text);
$text=preg_replace("/\[url=(http:\/\/.+?)\](.*)\[\/url\]/is","<a href=\\1>\\2</a>",$text);
$text=preg_replace("/\[url=(.+?)\](.*)\[\/url\]/is","<a href=http://\\1>\\2</a>",$text);
$text=preg_replace("/\[img\](.+?)\[\/img\]/is","<img src=\\1>",$text);
$text=preg_replace("/\[color=(.+?)\](.+?)\[\/color\]/is","<font color=\\1>\\2</font>",$text);
$text=preg_replace("/\[size=(.+?)\](.+?)\[\/size\]/is","<font size=\\1>\\2</font>",$text);
$text=preg_replace("/\[sup\](.+?)\[\/sup\]/is","<sup>\\1</sup>",$text);
$text=preg_replace("/\[sub\](.+?)\[\/sub\]/is","<sub>\\1</sub>",$text);
$text=preg_replace("/\[pre\](.+?)\[\/pre\]/is","<pre>\\1</pre>",$text);
$text=preg_replace("/\[email\](.+?)\[\/email\]/is","<a href=\\1>\\1</a>",$text);
$text=preg_replace("/\[i\](.+?)\[\/i\]/is","<i>\\1</i>",$text);
$text=preg_replace("/\[b\](.+?)\[\/b\]/is","<b>\\1</b>",$text);
$text=preg_replace("/\[quote\](.+?)\[\/quote\]/is","<blockquote><font size='1' face='courier new'>quote:</font><hr>\\1<hr></blockquote>", $text);
$text=preg_replace("/\[code\](.+?)\[\/code\]/is","<blockquote><font size='1' face='times new roman'>code:</font><hr color='lightblue'><i>\\1</i><hr color='lightblue'></blockquote>", $text);
$text=preg_replace("/\[sig\](.+?)\[\/sig\]/is","<div style='text-align: left; color: darkgreen; margin-left: 5%'><br><br>--------------------------<br>\\1<br>--------------------------</div>", $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"<table align=\"center\"><tr><td><a href=\"javascript:history.go(-1)\">$saying</a>";
}
///////////////////判断字符串中是否含有array中的某一值/////////////////
function instring($array,$string){
while(list(,$value)=each($array)){
if(eregi($value,$string)){
return true;
exit;
}
}
}
////////////////////链接到某一页面///////////////////////////////////////
function goin($addr,$saying){
echo"<table align=\"center\"><tr><td><a href=\"$addr\">$saying</a></td></tr></table>";
}
////////////////////js返回//////////////////////////////////////////////
function isint($string){
if(ereg("^[0-9]{0,}$",$string)){
return true;
}
else {
return false;
}
}
?>
如对本文有疑问,请在下面进行留言讨论,广大热心网友会与你互动!!
点击进行留言回复
相关文章:
-
-
-
-
Yii框架应用组件用法实例分析
本文实例讲述了yii框架应用组件用法。分享给大家供大家参考,具体如下:应用组件 应用主体是, 它部署一组提供各种不同功能的 应用组件 来处理请求。 例如,url...
[阅读全文]
-
-
-
-
-
Yii 框架入口脚本示例分析
本文实例讲述了yii 框架入口脚本。分享给大家供大家参考,具体如下:入口脚本入口脚本是应用启动流程中的第一环, 一个应用(不管是网页应用还是控制台应用)只有一个...
[阅读全文]
-
PHP强制转化的形式整理
php强制转化有几种形式php强制转化有3种形式:1、在要转换的变量之前加上用括号括起来的目标类型;2、使用转强函数,如“intval()”,“strval()...
[阅读全文]
-
php7 新增功能实例总结
本文实例总结了php7 新增功能。分享给大家供大家参考,具体如下:一、核心 增加了group use语法声明。rfc: https://wiki.php.ne...
[阅读全文]
网友评论