All i want to do is transform (b)Hello(/b) into hello
of course i will use brackets not parenthesis. thanks for your help.
Moderator: General Moderators
Code: Select all
// the string to evaluate
$strtoeval = 'їb]Manї/b]... this regex stuff smells like їb]Doodieї/b]!';
// the strings to replace їb] and ї/b] with
$replace = array("<b>", "</b>");
// the string that match їb] and ї/b]
$pattern = array("/(\їїbB]\])/", "/(\ї\/їbB]\])/");
print preg_replace($pattern, $replace, $strtoeval);Code: Select all
I suggest you visit їlink="http://www.evilwalrus.com"]Evil Walrusї/link] or їlink="http://www.php.net"]php.netї/link] for more help.