时间:2021-07-01 10:21:17 帮助过:25人阅读
$str = '2abc';输出结果正常:7abc
$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;
//
$str = '2abc';输出结果有误:Wabc
$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;
//