$input = "This is *bold*";
$output = magic($input);
echo $output; // should output "This is <b>bold</b>";
Basically how to turn [b]*[/b]
into <b>*</b>
? I know you can change every [b]
into <b>
with preg_replace()
. But I’m seeking something that would seek for entire [b]fjasodisajdoiadisjdo[/b]
and replace it with <b>fjasodisajdoiadisjdo</b>
rather than replacing selectors one by one.
Any way to tackle this?