PhpUBB parsing php UBB parsing
/** + Parse * UBB resolution + ---------------------------------------------------------- * @ return string + response */function ubb ($ Text) {$ Text = trim ($ Text ); $ Text = ereg_replace ("\ n ","
", $ Text); $ Text = preg_replace ("/\ t/is "," ", $ Text ); $ Text = preg_replace ("/\ [hr \]/is", "", $ Text); $ Text = preg_replace ("/\ [separator \]/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 "," \ 2 ", $ Text); $ Text = preg_replace ("/\ [url = (. + ?) \] (. + ?) \ [\/Url \]/is "," \ 2 ", $ Text); $ Text = preg_replace ("/\ [img \] (. + ?) \ [\/Img \]/is "," ", $ Text); $ Text = preg_replace ("/\ [img \ s (. + ?) \] (. + ?) \ [\/Img \]/is "," ", $ 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 ","
Reference:
\ 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); return $ Text ;}
The above is the content parsed by php UBB. For more information, see The PHP Chinese website (www.php1.cn )!