BBCode?
| From: | Leif K-Brooks | Date: | Mon, 25 Nov 2002 06:00:08 +0000 |
| Subject: | BBCode? | ||
| Groups: | php.general | ||
| Request: | Send a blank email to php-general+get-125886@lists.php.net to get a copy of this message | ||
I'm working on adding simple BBCode to my site. I'm currently using the [i] tag for testing, with the following code:
<?php
function bbcode($text){
$text = ereg_replace('\\[i\\](.{1,})\\[/i\\]','<i>\\1</i>',$text);
return $text;
}
print bbcode('[i]This[/i] is a [i]test[/i].');
?>
But it prints "<i>This[/i] is a [i]test</i>". Is there a better way to do this?
--
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.