Re: Re: BBCode?
| From: | Leif K-Brooks | Date: | Mon, 25 Nov 2002 17:42:01 +0000 |
| Subject: | Re: Re: BBCode? | ||
| References: | 1 2 3 4 5 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-125959@lists.php.net to get a copy of this message | ||
Thanks, but that doesn't allow nested tags (a [b] tag inside of an [i] tag, for example).
Kyle Gibson wrote:
-- The above message is encrypted with double rot13 encoding. Any unauthorized attempt to decrypt it will be prosecuted to the full extent of the law.Thanks a lot, but do you know how to do the same with ereg_replace? I'm trying to learn PCRE, but until I do, I won't be able to add anything to this...<?php function bbcode($text){ $text = ereg_replace("(\\[i\\])([^\\[]+)(\\[/i\\])",'<i>\\2</i>',$text); return $text; } print bbcode('[i]This[/i] is a [i]test[/i].'); ?> Works...