婷婷综合国产,91蜜桃婷婷狠狠久久综合9色 ,九九九九九精品,国产综合av

主頁 > 知識(shí)庫(kù) > 自定義ubb代碼,preg_replace()函數(shù)的一些代碼

自定義ubb代碼,preg_replace()函數(shù)的一些代碼

熱門標(biāo)簽:廣西智能外呼系統(tǒng)多少錢 外呼系統(tǒng)api對(duì)接 平?jīng)龈叩碌貓D標(biāo)注商戶要收費(fèi)嗎 地圖標(biāo)注與公司業(yè)務(wù)關(guān)系 荊州智能電銷機(jī)器人 福建微碼電話機(jī)器人 提高電話機(jī)器人接通率 銷售電銷機(jī)器人詐騙 大學(xué)校門地圖標(biāo)注
function ubb($Text) { 
  $Text=htmlspecialchars($Text); 
  $Text=ereg_replace("\r\n","br>",$Text); 
  $Text=ereg_replace("\r","br>",$Text); 
  $Text=nl2br($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("/\[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='2' face='Courier New'>quote:/font>hr>\\1hr>/blockquote>", $Text); 
  $Text=preg_replace("/\[code\](.+?)\[\/code\]/is","blockquote>font size='2' face='Courier New'>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>\\1br>--------------------------/div>", $Text); 
return $Text; 

function str($msg){
  global $admin;
  if(!$admin[html]) $msg=htmlspecialchars($msg);
  if($admin[ubb]) $msg=ubb($msg);
  $msg=nl2br($msg); #處理message
  $msg= str_replace("\n","",$msg); #處理message
  $msg= str_replace("\r","",$msg); #處理message
  return $msg;
}
function error($msg){
global $admin;
?>

中的
$Text=preg_replace("/\[h2\](.+?)\[\/h2\]/is","h2>\\1/h2>",$Text); 

里面的 ("/\[h2](.+?)\[\/h2]/is","h2>\\1/h2>",$text)

/\[h2](.+?)\[\/h2]/is  轉(zhuǎn)化成 h2>\\1/h2>

/\[h2](.+?)\[\/h2]/is  里面的 這些"/\(.+?)\&;"之類的符號(hào)是怎么看的?是什么意思?
______________________________________________________________________________________________

\是轉(zhuǎn)意,\本身是特殊符號(hào),如果要作為普通字符就要用\來轉(zhuǎn)意,就是說\\表示()也是特殊符號(hào),所以要用\轉(zhuǎn)意
您可能感興趣的文章:
  • php正則之函數(shù) preg_replace()參數(shù)說明
  • eregi_replace()中特殊字符的處理方法
  • javascript replace()用法詳解附實(shí)例代碼
  • javascript replace()正則替換實(shí)現(xiàn)代碼
  • js replace() 文本替換你所不知的
  • js中字符替換函數(shù)String.replace()使用技巧
  • PHP preg_replace() 正則替換所有符合條件的字符串
  • 淺談jQuery中replace()方法
  • 淺談javascript中replace()方法
  • 淺談C++中replace()方法

標(biāo)簽:海南 婁底 樂山 內(nèi)江 衡陽 黔東 邯鄲 德陽

巨人網(wǎng)絡(luò)通訊聲明:本文標(biāo)題《自定義ubb代碼,preg_replace()函數(shù)的一些代碼》,本文關(guān)鍵詞  自定義,ubb,代碼,preg,replace,;如發(fā)現(xiàn)本文內(nèi)容存在版權(quán)問題,煩請(qǐng)?zhí)峁┫嚓P(guān)信息告之我們,我們將及時(shí)溝通與處理。本站內(nèi)容系統(tǒng)采集于網(wǎng)絡(luò),涉及言論、版權(quán)與本站無關(guān)。
  • 相關(guān)文章
  • 下面列出與本文章《自定義ubb代碼,preg_replace()函數(shù)的一些代碼》相關(guān)的同類信息!
  • 本頁收集關(guān)于自定義ubb代碼,preg_replace()函數(shù)的一些代碼的相關(guān)信息資訊供網(wǎng)民參考!
  • 推薦文章
    主站蜘蛛池模板: 南川市| 广宗县| 调兵山市| 白朗县| 宁国市| 汝城县| 峨边| 江孜县| 珠海市| 海原县| 西吉县| 台州市| 江华| 荥阳市| 科技| 高邮市| 云和县| 余江县| 桂东县| 黄石市| 宜章县| 自贡市| 潮安县| 台前县| 霍州市| 贵南县| 陆丰市| 郸城县| 屏山县| 静安区| 锡林浩特市| 文山县| 嘉祥县| 东城区| 随州市| 仁寿县| 师宗县| 阜南县| 东安县| 鹤山市| 德州市|