I've got the following str_replace code:
$filterString = "[++] has performed well. [++] is showing good understanding";
echo str_replace("[++]", "Name", $filterString);
It basically replaces all instances of [++]
with Name. However, i would like to only replace the first instance of the [++]
with Name and all other instances should say He
Any idea how i can do this?
Thanks