- strtr: documentation ( source)
<?php
// expecting 'bcde' to be replaced first
echo strtr('abcdef', ['abc'=> '1', 'bcde'=> '2']) . "\n";
// the following two are replaced as expected, just to give more info
echo strtr('abcdef', ['a'=> '2', 'abc'=> '1']) . "\n";
echo strtr('abcdef', ['abcd'=> '2', 'abc'=> '1']) . "\n";