strtr() with 2nd param array - optimization

About a 1.25x speedup in my test script by writing the result string
only when a match is found and at the end instead of on each iteration.