$myVar="abcd ABCD abcd";
$myVar1=str_ireplace("b", "",$myVar);
[b]result1[/b]
acd ACD acd
$myVar2=str_replace("b", "",$myVar);
[b]result2[/b]
acd ABCD acd
The code above prouduces the result above.
I like to replace “b” just one time.
The would-be code below doesn’t work correctly, but I hope it show what I want.
[b]would-be code[/b]
$myVar3=str_ireplace("b", "",$myVar, [COLOR="#FF0000"]1[/COLOR]);
[b]target result[/b]
acd ABCD abcd
How can I get my target result above?