源代码:
array("red"),"b"=>array("green","blue"),); $a2=array("a"=>array("yellow"),"b"=>array("black")); $result=array_replace_recursive($a1,$a2); print_r($result); $result=array_replace($a1,$a2); print_r($result); ?>
运行结果:
Array ( [a] => Array ( [0] => yellow ) [b] => Array ( [0] => black [1] => blue ) ) Array ( [a] => Array ( [0] => yellow ) [b] => Array ( [0] => black ) )