note 89401 added to function.array-merge-recursive
| From: | n dot kaiser at online-congress dot com | Date: | Fri, 06 Mar 2009 07:24:47 +0000 |
| Subject: | note 89401 added to function.array-merge-recursive | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-151546@lists.php.net to get a copy of this message | ||
Here ist my array recursive merge function
/**
* merge a array recursive
*
* @param array $array1: original array
* @param array $array2: the array to insert
* @return array the merged array
*/
public function recursiveArrayMerge($array1, $array2){
reset ($array2);
while(key($array2)!==null) {
if (is_array(current($array2)) && isset($array1[key($array2)])) {
$array1[key($array2)] = $this->recursiveArrayMerge($array1[key($array2)],current($array2));
} else {
$array1[key($array2)] = current($array2);
}
next($array2);
}
return $array1;
}
----
Server IP: 217.13.201.10
Probable Submitter: 212.82.245.218
----
Manual Page -- http://www.php.net/manual/en/function.array-merge-recursive.php
Edit -- https://master.php.net/note/edit/89401
Del: integrated -- https://master.php.net/note/delete/89401/integrated
Del: useless -- https://master.php.net/note/delete/89401/useless
Del: bad code -- https://master.php.net/note/delete/89401/bad+code
Del: spam -- https://master.php.net/note/delete/89401/spam
Del: non-english -- https://master.php.net/note/delete/89401/non-english
Del: in docs -- https://master.php.net/note/delete/89401/in+docs
Del: other reasons-- https://master.php.net/note/delete/89401
Reject -- https://master.php.net/note/reject/89401
Search -- https://master.php.net/manage/user-notes.php