Hi, I was wondering how I could search a string for multiple <b> tags, and replace it with one.
EDIT: Thanks in advance
$newVar = ereg_replace("<b>","<i>",$oldVar); echo $newVar;
This searches for any <b> and replaces it with <i>.
No need to use regex, if all they are doing is a simple replace, str_replace will be faster...
No, I want only one <b> tag if there is more than one in a string...
ex: <b><b><b> -> <b> <b><b> -> <b> ETC.
So I want to know if it's possible to remove multiple tags, so there is only one left.
BUMP
$newVar = ereg_replace("(<[bB]>)+","<b>",$oldVar); echo $newVar;
Note: For some reason the message board script is placing a space between > and ). It shouldn't be in there.