I have a php string like:
$string = '1234532323%A73823823221A%221312373712';
the string has numbers and 2 special tags (%A and A%)
to indicate the begin and the end of the special part, respectively.
My goal is to replace all "1" with "2", but not in the part of the string between %A and A%.
If I use strtr(string,"1","2")
all 1 occurrences will be replaced.
Does anyone know how my goal can be achieved?
Special characters may appear several times inside the string.