View Single Post
Old 01-11-2008, 08:15 PM   #1 (permalink)
ReSpawN
The Frequenter
 
ReSpawN's Avatar
 
Join Date: Nov 2007
Location: Netherlands
Posts: 460
Thanks: 49
ReSpawN is on a distinguished road
Default BBCode preg_match => str_replace

G'd evening guys,

I'm trying to get a BBCode editor to work.

In code tags for PHP, I've got this;

PHP Code:
[b]This text is bold.[/b]
[
code]This code [b]however[/bis not boldsince we want to see the code.[/code
What is the best way, to recognize if there is any BBCode between the code tags and not transform them, but show them as their are instead of making them strong.

I myself thought first of str_replace, but then you'll need to search into the code tags if ANY BBCode is present...

Anyways, I am out of options so maybe the RegEx specialist or BBCode specialists could help me out.

ReSpawN
__________________
"Life is a bitch, take that bitch on a ride"
Send a message via MSN to ReSpawN
ReSpawN is offline  
Reply With Quote