From 169671a444fd07ae491e4dfa3e7f1b540738c404 Mon Sep 17 00:00:00 2001 From: Jakub Vrana Date: Wed, 16 Feb 2005 15:27:02 +0000 Subject: [PATCH] 'duplicate entries will be merged into the last one' - this has nothing to do with array_merge without it, example 3 is a copy of example 2 git-svn-id: https://svn.php.net/repository/phpdoc/en/trunk@179885 c90b9560-bf6c-de11-be94-00142212c4b1 --- reference/array/functions/array-merge.xml | 45 +---------------------- 1 file changed, 2 insertions(+), 43 deletions(-) diff --git a/reference/array/functions/array-merge.xml b/reference/array/functions/array-merge.xml index 53105c367d..69b52e74d9 100644 --- a/reference/array/functions/array-merge.xml +++ b/reference/array/functions/array-merge.xml @@ -1,5 +1,5 @@ - + @@ -28,8 +28,7 @@ If only one array is given and the array is numerically indexed, the - keys get reindexed in a continuous way. For associative arrays, duplicate - entries will be merged into the last one. See example three for details. + keys get reindexed in a continuous way. @@ -108,50 +107,10 @@ Array ( [1] => data ) -]]> - - - - <function>array_merge</function> example - - "jay", 1 => "bob", 2 => "randal", 3 => "dante"); -$array_two = array("jay" => "bob", "randal" => "dante", "jay" => "jason"); - -unset($array_one[2]); - -$result_one = array_merge($array_one); -$result_two = array_merge($array_two); - -print_r($result_one); -print_r($result_two); -?> -]]> - - &example.outputs; - - jay - [1] => bob - [2] => dante -) -Array -( - [jay] => jason - [randal] => dante -) ]]> - - - Shared keys will be overwritten on a first-come first-served basis. - - The behavior of array_merge was modified in PHP 5. Unlike PHP 4, array_merge