note 31852 deleted from function.array-merge by alindeman
| From: | alindeman@php.net | Date: | Tue, 06 May 2003 20:39:59 +0000 |
| Subject: | note 31852 deleted from function.array-merge by alindeman | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-47598@lists.php.net to get a copy of this message | ||
Hey, looking for a way to do this, not sure off the top of my head.
$array1 = array ("Apples" => "4", "Oranges" => "3",
"Bananas" => "5");
$array1 = array ("Apples" => "2", "Oranges" => "4",
"Bananas" => "1");
$result = array_merge ($array1, $array2);
And I want $result to be the key name with the values added together. Like this...
Array
(
[Apples] => 6
[Oranges] => 7
[Bananas] => 6
)
Any idea off of the tops of your heads?