note 37942 deleted from ref.array by didou
| From: | didou@php.net | Date: | Tue, 09 Dec 2003 13:37:01 +0000 |
| Subject: | note 37942 deleted from ref.array by didou | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-61684@lists.php.net to get a copy of this message | ||
Note Submitter: mikething
----
There is no built in way to concatenate (join together) two arrays. really annoying oversight.
Here's a function:
function concat($first,$second) {
foreach ($second as $i=>$val)array_push($first,$val);
return $first;
}
so that...
$arr1 = array("hello");
$arr2 = array("momma");
$arr3 = concat($arr1,$arr2);
makes arr3 become array("hello","momma")
This function doesn't deal with keys tho. check this out...
http://forums.devshed.com/archive/5/2001/1/4/10096