我正在寻找一个适用于
PHP的UTF-8兼容strtr.
function strtr_utf8($str,$from,$to) { $keys = array(); $values = array(); preg_match_all('/./u',$keys); preg_match_all('/./u',$to,$values); $mapping = array_combine($keys[0],$values[0]); return strtr($str,$mapping); }