note 105651 deleted from function.array-merge by tularis
| From: | tularis@php.net | Date: | Mon, 05 Sep 2011 12:52:22 +0000 |
| Subject: | note 105651 deleted from function.array-merge by tularis | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-182945@lists.php.net to get a copy of this message | ||
Note Submitter: heitor dot siller at gmail dot com
Reason: useless
----
The function posted by
jpakin at gmail dot com 11-Jun-2010 03:46
Is extremely FAST! It was tooking me about 200 seconds to merge 25,000 arrays using the ordinary
array_merge function, but the proposed one took not more than 5 seconds. Fantastic contribution!
Here's it again:
<?php
function mergeArrays(&$sourceArray, &$copyArray){
//merge copy array into source array
$i = 0;
while (isset($copyArray[$i])){
$sourceArray[] = $copyArray[$i];
unset($copyArray[$i]);
$i++;
}
}
?>