Hi,
I'm having a hard time doing single-replace (as opposed-to multiple replace) using preg_replace
This is the string that I want to replace:
A F C7 D
I want them to be replaced to:
F C# G#7 A#
My function is $output = preg_replace($search, $replace, $string);
where $search is an Array ( [0] => A [1] => F [2] => C7 [3] => D )
and $replace is an Array ( [0] => F [1] => C# [2] => G#7 [3] => A# )
However, using the function above will yield the result:
C# C# G#7 A#
The letter A is replaced with F, and then replaced again with C#, which is not what I want. I want each letter to be replaced only once. How do I accomplish that?
Thanks