Jump to content

preg_replace help


LemonInflux

Recommended Posts

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

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.