08-04-2008, 03:32 PM
|
#3 (permalink)
|
|
The Prestige
Join Date: Oct 2007
Location: Manchester, UK
Posts: 854
Thanks: 32
|
This should get you started.
p.s. im not the best at regex so im sure there is a quicker way.
PHP Code:
$string = '[bold]this will be turned bold hopefully[/bold]'; echo preg_replace('/\[bold\](.*)\[\/bold\]/is', '<b>\\1</b>', $string);
__________________
mysql> SELECT * FROM `users` WHERE `users`.`clue` > 0;
Empty set (0.00 sec)
Last edited by sketchMedia : 08-04-2008 at 03:45 PM.
Reason: added s modifier so it matches blocks across new lines
|
|
|
|