日期:2014-05-16 浏览次数:20493 次
$str = '2abc';
$arr1 = array('0', '1', '2', '3', '4', '5', '6');
$arr2 = array('9', '8', '7', '6', '5', '4', '3');
$str = str_replace($arr1, $arr2, $str);
echo $str;
//输出结果正常:7abc
$str = '2abc';
$arr1 = array('0', '1', '2', '3', '4', '5', '6', '7');
$arr2 = array('9', '8', '7', '6', '5', '4', '3', 'W');
$str = str_replace($arr1, $arr2, $str);
echo $str;
//输出结果有误:Wabc