str_replace批量替换 <?php $str = "aaaabbbb"; $a = array('a','b'); $b = array('c','d'); echo str_replace($a,$b,$str); 运行结果:ccccdddd