时间:2021-07-01 10:21:17 帮助过:5人阅读
- <br>/** <br>+---------------------------------------------------------- <br>* UBB 解析 <br>+---------------------------------------------------------- <br>* @return string <br>+---------------------------------------------------------- <br>*/ <br>function ubb($Text) { <br>$Text=trim($Text); <br>$Text=ereg_replace("\n","<br>",$Text); <br>$Text=preg_replace("/\\t/is"," ",$Text); <br>$Text=preg_replace("/\[hr\]/is","<hr>",$Text); <br>$Text=preg_replace("/\[separator\]/is","<br>",$Text); <br>$Text=preg_replace("/\[h1\](.+?)\[\/h1\]/is","<h2>\https://www.gxlcms.com/\1</h2>",$Text); <br>$Text=preg_replace("/\[h2\](.+?)\[\/h2\]/is","<h2>\https://www.gxlcms.com/\1</h2>",$Text); <br>$Text=preg_replace("/\[h3\](.+?)\[\/h3\]/is","<h3>\https://www.gxlcms.com/\1</h3>",$Text); <br>$Text=preg_replace("/\[h4\](.+?)\[\/h4\]/is","<h4>\https://www.gxlcms.com/\1</h4>",$Text); <br>$Text=preg_replace("/\[h5\](.+?)\[\/h5\]/is","<h5>\https://www.gxlcms.com/\1</h5>",$Text); <br>$Text=preg_replace("/\[h6\](.+?)\[\/h6\]/is","<h6>\https://www.gxlcms.com/\1</h6>",$Text); <br>$Text=preg_replace("/\[center\](.+?)\[\/center\]/is","<center>\https://www.gxlcms.com/\1</center>",$Text); <br>//$Text=preg_replace("/\[url=([^\[]*)\](.+?)\[\/url\]/is","\\2",$Text); <br>$Text=preg_replace("/\[url\](.+?)\[\/url\]/is","\https://www.gxlcms.com/\1",$Text); <br>$Text=preg_replace("/\[url=(http:\/\/.+?)\](.+?)\[\/url\]/is","\\2",$Text); <br>$Text=preg_replace("/\[url=(.+?)\](.+?)\[\/url\]/is","\\2",$Text); <br>$Text=preg_replace("/\[img\](.+?)\[\/img\]/is","<img src="\https://www.gxlcms.com/\1">",$Text); <br>$Text=preg_replace("/\[img\s(.+?)\](.+?)\[\/img\]/is","<img \https:="" www.gxlcms.com="" \1="" src="\\2">",$Text); <br>$Text=preg_replace("/\[color=(.+?)\](.+?)\[\/color\]/is","<font color="\https://www.gxlcms.com/\1">\\2</font>",$Text); <br>$Text=preg_replace("/\[colorTxt\](.+?)\[\/colorTxt\]/eis","color_txt('\https://www.gxlcms.com/\1')",$Text); <br>$Text=preg_replace("/\[style=(.+?)\](.+?)\[\/style\]/is","\\2",$Text); <br>$Text=preg_replace("/\[size=(.+?)\](.+?)\[\/size\]/is","<font size="\https://www.gxlcms.com/\1">\\2</font>",$Text); <br>$Text=preg_replace("/\[sup\](.+?)\[\/sup\]/is","<sup>\https://www.gxlcms.com/\1</sup>",$Text); <br>$Text=preg_replace("/\[sub\](.+?)\[\/sub\]/is","<sub>\https://www.gxlcms.com/\1</sub>",$Text); <br>$Text=preg_replace("/\[pre\](.+?)\[\/pre\]/is","<pre class="brush:php;toolbar:false layui-box layui-code-view layui-code-notepad"><ol class="layui-code-ol"><li>\https://www.gxlcms.com/\1</li></ol></pre>",$Text); <br>$Text=preg_replace("/\[emot\](.+?)\[\/emot\]/eis","emot('\https://www.gxlcms.com/\1')",$Text); <br>$Text=preg_replace("/\[email\](.+?)\[\/email\]/is","\https://www.gxlcms.com/\1",$Text); <br>$Text=preg_replace("/\[i\](.+?)\[\/i\]/is","<i>\https://www.gxlcms.com/\1</i>",$Text); <br>$Text=preg_replace("/\[u\](.+?)\[\/u\]/is","<u>\https://www.gxlcms.com/\1</u>",$Text); <br>$Text=preg_replace("/\[b\](.+?)\[\/b\]/is","<b>\https://www.gxlcms.com/\1</b>",$Text); <br>$Text=preg_replace("/\[quote\](.+?)\[\/quote\]/is","<blockquote>引用:\https://www.gxlcms.com/\1</blockquote>", $Text); <br>$Text=preg_replace("/\[code\](.+?)\[\/code\]/eis","highlight_code('\https://www.gxlcms.com/\1')", $Text); <br>$Text=preg_replace("/\[php\](.+?)\[\/php\]/eis","highlight_code('\https://www.gxlcms.com/\1')", $Text); <br>$Text=preg_replace("/\[sig\](.+?)\[\/sig\]/is","<br><br>--------------------------<br>\https://www.gxlcms.com/\1<br>--------------------------", $Text); <br>return $Text; <br>} <br>
- <p></p>
- <p align="left"><span id="url" itemprop="url">http://www.bkjia.com/PHPjc/324530.html</span><span id="indexUrl" itemprop="indexUrl">www.bkjia.com</span><span id="isOriginal" itemprop="isOriginal">true</span><span id="isBasedOnUrl" itemprop="isBasedOnUrl">http://www.bkjia.com/PHPjc/324530.html</span><span id="genre" itemprop="genre">TechArticle</span><span id="description" itemprop="description"> 代码如下:</span></p><pre class="brush:php;toolbar:false layui-box layui-code-view layui-code-notepad"><ol class="layui-code-ol"><li>/** +---------------------------------------------------------- * UBB 解析 +---------------------------------------------------------- * @return string...<p></p></li><li> </li></ol></pre>