PHP implementation of the conversion UBB Code, PHP conversion UBB Code _php Tutorial

Source: Internet
Author: User

PHP implementation of the method of converting UBB code, PHP conversion UBB code


This article describes the PHP implementation of the conversion Ubb code method. Share to everyone for your reference. Specific as follows:

function ubb2html ($content) {global $article;//whether automatic recognition of if ($article [' isparseurl '] = = "1") {$content = parseURL ($content);} Automatic recognition End $content = Eregi_replace (Quotemeta ("[b]"), Quotemeta (""), $content), $content = Eregi_replace (" [/b] "), Quotemeta (""), $content), $content = Eregi_replace (" [i] "), Quotemeta (""), $content), $content = Eregi_replace (" [/I] "), Quotemeta (""), $content), $content = Eregi_replace (" [u] "), Quotemeta (""), $content), $content = Eregi_replace (Quotemeta (" [/U] "), Quotemeta (""), $content), $content = Eregi_replace (" [Center] "), Quotemeta ("
 
  
   "), $content), $content = Eregi_replace (" [/center] "), Quotemeta ("
  
 "), $content), $content = Eregi_replace (" [quote] "), Quotemeta ("
 
 
Reference:
"), $content), $content = Eregi_replace (" [/quote] "), Quotemeta ("
"), $content); $content = Eregi_replace (Quotemeta ("Copy CodeThe code is as follows: "), Quotemeta ("
Code:
"), $content); $con Tent = Eregi_replace (Quotemeta (""), Quotemeta ("
"), $content); $content = Eregi_replace (" \\[images\\ "([^\\[]*) \\[/images\\]", "screen.width-333) this.width= Screen.width-333\ "Title=\" with a new window to browse the original picture \ ">", $content); $content = Eregi_replace ("\\[url\\]www." ( [^\\[]*] \\[/url\\] "," www.\\1 ", $content); $content = Eregi_replace (" \\[url\\ "([^\\[]*] \\[/url\\]", "\\1", $content); $content = Eregi_replace ("\\[url= ([^\\[]*) \ \] ([^\\[]*) \\[/url\\]", "\\2", $content); $content = Eregi_replace ("\\[ Email\\] ([^\\[]*) \\[/email\\] "," \\1 ", $content);//$content = preg_replace ('/javascript/i ', ' java Script ', $content); return $content;}

I hope this article is helpful to everyone's PHP programming.

http://www.bkjia.com/PHPjc/1019056.html www.bkjia.com true http://www.bkjia.com/PHPjc/1019056.html techarticle PHP Implementation of the method of converting UBB code, PHP conversion UBB Code This article describes the PHP implementation of the conversion Ubb code method. Share to everyone for your reference. Specific as follows: Function ubb2html ($ ...

  • Related Article

    Contact Us

    The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

    If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

    A Free Trial That Lets You Build Big!

    Start building with 50+ products and up to 12 months usage for Elastic Compute Service

    • Sales Support

      1 on 1 presale consultation

    • After-Sales Support

      24/7 Technical Support 6 Free Tickets per Quarter Faster Response

    • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.