preg_replace(\"/\\[b\\](.*)\\[\\/b\\]/Usi\", \"$1\", \"Some text here... [b][b]Hello, [b]PHP![/b][/b][/b] ... [b]and here[/b]\");
edit your modifiers Usi and replace it with sim.
Usi
sim
EDIT:
Give this a shot:
$1', $str); echo $str;