note 67962 added to function.array-merge-recursive

From: Date: Fri, 07 Jul 2006 17:04:16 +0000
Subject: note 67962 added to function.array-merge-recursive
Groups: php.notes 
Request: Send a blank email to php-notes+get-114558@lists.php.net to get a copy of this message
This function tends to reindex arrays, which is not mentioned in the function description. I just tried to run that function on a three dimensional array, containing errormessages. The first dim. contains the severity of the error ('warn', 'crit') the second dim the linenumber (numerical) and the third one consists of errormessages <?php # Array printout: Array ( [warn] => Array // severity (associative) ( [2] => Array // linenumber (numerical) ( [0] => "Category does not exist" [1] => "Manufacturer does not exist" ) ) ) ?> If i now merge two or more of those arrays using array_merge_recursive(), the linenumbers are not conserved. Instead of, they are all renumbered, starting with 0. Just thought anyone may want to know about that. :) regards, smilingrasta ---- Server IP: 212.124.37.9 Probable Submitter: 83.236.176.115 ---- X-Spam-Status: No, hits=3.1 required=5.0 tests=DATE_MISSING,FROM_NO_LOWER autolearn=no version=2.64 ---- Manual Page -- http://www.php.net/manual/en/function.array-merge-recursive.php Edit -- http://master.php.net/note/edit/67962 Del: integrated -- http://master.php.net/note/delete/67962/integrated Del: useless -- http://master.php.net/note/delete/67962/useless Del: bad code -- http://master.php.net/note/delete/67962/bad+code Del: spam -- http://master.php.net/note/delete/67962/spam Del: non-english -- http://master.php.net/note/delete/67962/non-english Del: in docs -- http://master.php.net/note/delete/67962/in+docs Del: other reasons-- http://master.php.net/note/delete/67962 Reject -- http://master.php.net/note/reject/67962 Search -- http://master.php.net/manage/user-notes.php

« previous php.notes (#114558) next »