时间:2021-07-01 10:21:17 帮助过:3人阅读
本文实例讲述了php实现转换ubb代码的方法。分享给大家供大家参考。具体如下:
function ubb2html($content) { global $article; //是否自动识别 if ($article['isparseurl'] == "1") { $content = parseurl($content); } //自动识别结束 $content = eregi_replace(quotemeta("[b]"),quotemeta(""),$content); $content = eregi_replace(quotemeta("[/b]"),quotemeta(""),$content); $content = eregi_replace(quotemeta("[i]"),quotemeta(""),$content); $content = eregi_replace(quotemeta("[/i]"),quotemeta(""),$content); $content = eregi_replace(quotemeta("[u]"),quotemeta(""),$content); $content = eregi_replace(quotemeta("[/u]"),quotemeta(""),$content); $content = eregi_replace(quotemeta("[center]"),quotemeta(""),$content); $content = eregi_replace(quotemeta("[/center]"),quotemeta(" "),$content); $content = eregi_replace(quotemeta("[quote]"),quotemeta("
引用: |
"),$content); $content = eregi_replace(quotemeta("[/quote]"),quotemeta(" |
代码: |
"),$content); $content = eregi_replace(quotemeta(""),quotemeta(" |
希望本文所述对大家的php程序设计有所帮助。
http://www.bkjia.com/PHPjc/1019056.htmlwww.bkjia.comtruehttp://www.bkjia.com/PHPjc/1019056.htmlTechArticlephp实现转换ubb代码的方法,php转换ubb代码 本文实例讲述了php实现转换ubb代码的方法。分享给大家供大家参考。具体如下: function ubb2html($...