Re: Re: Converting HTML to BBCode [SOLVED]
| From: | Rafael | Date: | Tue, 07 Mar 2006 14:38:04 +0000 |
| Subject: | Re: Re: Converting HTML to BBCode [SOLVED] | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-231586@lists.php.net to get a copy of this message | ||
Hi,
I'm glad it worked (so far, hehe) Also, there's something I forgot to tell you (though I think you may as well be already doing this): there will be some unknown tags for the to_bbcode() function (even maybe some variations of those that it should recognize but it won't), so you should take care of those tags too, with something similar to this:
$text = to_bbcode($text); // try to convert to BBCode $text = strip_tags($text); // get rid of remaining tags$text = htmlspecialchars($text); // replace basic HTML-entities J_K9 wrote:
Hi, Thank you for that - although I do have to admit that I don't understand a single bit of the reg-exp part. :) It is now working flawlessly! Here is the final code I used: [···]
Thank you very much for your help! I hope I get onto reg-exp and PREG stuff soon so that someday I might be able to understand that code.. :DGood luck on that. Oh, a little correction: it should be PCRE not PREG, "preg_" is the functions prefix (my mistake, sorry) -- Atentamente, J. Rafael Salazar Magaña Innox - Innovación Inteligente Tel: +52 (33) 3615 5348 ext. 205 / 01 800 2-SOFTWARE http://www.innox.com.mx