For my bbcode parser, I'm using str_ireplace
However, this replaces all ']' with another bbcode's markup, no matter what.
For example,
PHP Code:
$message = str_ireplace(array("[quot usr=\"", "\"], "[/quot]"), array("<b>", "</b><i>", "</i>"), $message);
$message = str_ireplace(array("[link href=\"", "\"]", "[/link]"), array("<a href=\"", "\">", "</a>"), $message);
Since the [quote] tag is parsed first, all instances of "]", even if its [link href="bob"].
So is there anyway to solve this?
Or do I have to use preg_replace instead?
Lol, the code's kinda messed up cuz I'm using html tags and stuff, so just bear with it. :D
Whoops, wrong section lol.