Originally posted by drawmack
[man]preg_replace[/man]
The below seems to work. Please correct me if im wrong:
To get the message in quotes:
$message = preg_replace('#\[quote=(.*?)\](.*?)\[/quote\]#i', 'Quote from <strong>$1</strong>:<br/><span class="msghighlight">$2</span>', $message);
To remove the quotes and message:
$message = preg_replace('#\[quote=(.*?)\](.*?)\[/quote\]#', ' ', $message);