検索
ホームページphp教程php手册php UBB 解析実装コード

php UBB 解析実装コード

Jun 13, 2016 pm 12:04 PM
phpコードコピー成し遂げる解析する

复制代 代码如下:


/**
----------------------------------------------- ----------
* UBB 分析
----------------------------- ----------------------------
* @return string
------------ -----------------------------------------------
*/
function ubb($Text) {
$Text=トリム($Text);
$Text=ereg_replace("n","
",$Text);
$Text=preg_replace("/\t/is"," ",$Text);
$Text=preg_replace("/[hr]/is","


",$Text);
$Text=preg_replace("/[セパレータ]/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=([^[]*)](. ?)[/url]/is"," \2",$Text);
$Text=preg_replace("/[url](. ?)[/url]/is","\1", $Text);
$Text=preg_replace("/[url=(http://. ?)](. ?)[/url]/is","",$Text);
$Text=preg_replace("/[url=(. ?)](. ?)[/url]/is","
\2",$Text) ;
$Text=preg_replace("/[img](. ?)[/img]/is","php UBB 解析実装コード",$Text);
$Text=preg_replace("/[imgs(. ?)](. ?)[/img]/is","php UBB 解析実装コード",$Text);
$Text=preg_replace("/[color=(. ?)](. ?)[/color]/is","\2",$Text) ;
$Text=preg_replace("/[colorTxt](. ?)[/colorTxt]/eis","color_txt('\1')",$Text);
$Text=preg_replace("/[style=(. ?)](. ?)[/style]/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("/[emot](. ?)[/emot]/eis","emot('\1')",$Text);
$Text=preg_replace("/[email](. ?)[/email]/is","\1",$Text) ;
$Text=preg_replace("/[i](. ?)[/i]/is","\1",$Text);
$Text=preg_replace("/[u](. ?)[/u]/is","\1",$Text);
$Text=preg_replace("/[b](. ?)[/b]/is","\1",$Text);
$Text=preg_replace("/[quote](. ?)[/quote]/is","
引用:
\1
", $Text);
$Text=preg_replace("/[code](. ?)[/code]/eis","highlight_code('\1')", $Text);
$Text=preg_replace("/[php](. ?)[/php]/eis","highlight_code('\1')", $Text);
$Text=preg_replace("/[sig](. ?)[/sig]/is","

--------------------------
\1
------ --------------------
", $Text);
$Text を返す;
}
声明
この記事の内容はネチズンが自主的に寄稿したものであり、著作権は原著者に帰属します。このサイトは、それに相当する法的責任を負いません。盗作または侵害の疑いのあるコンテンツを見つけた場合は、admin@php.cn までご連絡ください。

ホットAIツール

Undresser.AI Undress

Undresser.AI Undress

リアルなヌード写真を作成する AI 搭載アプリ

AI Clothes Remover

AI Clothes Remover

写真から衣服を削除するオンライン AI ツール。

Undress AI Tool

Undress AI Tool

脱衣画像を無料で

Clothoff.io

Clothoff.io

AI衣類リムーバー

Video Face Swap

Video Face Swap

完全無料の AI 顔交換ツールを使用して、あらゆるビデオの顔を簡単に交換できます。

ホットツール

ドリームウィーバー CS6

ドリームウィーバー CS6

ビジュアル Web 開発ツール

SAP NetWeaver Server Adapter for Eclipse

SAP NetWeaver Server Adapter for Eclipse

Eclipse を SAP NetWeaver アプリケーション サーバーと統合します。

mPDF

mPDF

mPDF は、UTF-8 でエンコードされた HTML から PDF ファイルを生成できる PHP ライブラリです。オリジナルの作者である Ian Back は、Web サイトから「オンザフライ」で PDF ファイルを出力し、さまざまな言語を処理するために mPDF を作成しました。 HTML2FPDF などのオリジナルのスクリプトよりも遅く、Unicode フォントを使用すると生成されるファイルが大きくなりますが、CSS スタイルなどをサポートし、多くの機能強化が施されています。 RTL (アラビア語とヘブライ語) や CJK (中国語、日本語、韓国語) を含むほぼすべての言語をサポートします。ネストされたブロックレベル要素 (P、DIV など) をサポートします。

メモ帳++7.3.1

メモ帳++7.3.1

使いやすく無料のコードエディター

ゼンドスタジオ 13.0.1

ゼンドスタジオ 13.0.1

強力な PHP 統合開発環境