En que array_merge_recursive, si hay 2 o mas elementos con la misma llave, los une creando un array.
Usando el ejemplo en el manual para array_merge_recursive:
Código PHP:
<?php
$m1 = array("color" => array("favorito" => "rojo"), 5);
$m2 = array(10, "color" => array("favorito" => "verde", "azul"));
$resultado = array_merge_recursive($m1, $m2);
print_r($resultado);
?>
Usando array_merge_recursive obtenemos:
Código:
Array
(
[color] => Array
(
[favorito] => Array
(
[0] => rojo
[1] => verde
)
[0] => azul
)
[0] => 5
[1] => 10
)
Con array_merge:
Código:
Array
(
[color] => Array
(
[favorito] => verde
[0] => azul
)
[0] => 5
[1] => 10
)
http://www.php.net/manual/es/functio...-recursive.php http://www.php.net/manual/es/function.array-merge.php