LemonInflux Posted November 4, 2007 Share Posted November 4, 2007 I'm trying to make sense of the BBCode tutorial on this website, and someone told me I should just look at how the regex is constructed, and follow suit. So, will someone please explain to me A) what this is, and B) how to make it work: <?php $data = preg_replace("`[b](.*)[/b]`sUi","<b>\1</b>",$data); ?> if I use that, and put [b]anything[/b], it doesn't work. Quote Link to comment https://forums.phpfreaks.com/topic/75990-preg_replace-help/ Share on other sites More sharing options...
Demonic Posted November 5, 2007 Share Posted November 5, 2007 Try: <?php $data = preg_replace("/\[b\](.*)\[\/b\]/si","<b>$1</b>",$data); ?> Quote Link to comment https://forums.phpfreaks.com/topic/75990-preg_replace-help/#findComment-384756 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.