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. 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); ?> Link to comment https://forums.phpfreaks.com/topic/75990-preg_replace-help/#findComment-384756 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.