Re: array_merge_recursive
| From: | Sebastian | Date: | Fri, 10 Dec 2004 18:51:36 +0000 |
| Subject: | Re: array_merge_recursive | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-203949@lists.php.net to get a copy of this message | ||
actually, what i mean is i need to get the animal name as well..
ie:
echo $animal . ' : ' . $total
would output:
<animal name> : <total>
<animal name> : <total>
etc. thanks.
----- Original Message -----
From: "Sebastian" <sebastian@broadbandgaming.net>
To: <php-general@lists.php.net>
Sent: Friday, December 10, 2004 12:24 PM
Subject: [PHP] array_merge_recursive
> Hi.
>
> I am using this array_merge_recursive to merge two arrays, the array looks
> like this:
>
> Array
> (
> [0] => Array
> (
> [animal] => Dogs
> [total] => 5
>
> )
>
> [1] => Array
> (
> [animal] => Cats
> [total] => 3
> )
>
> [2] => Array
> (
> [animal] => Cats
> [total] => 6
> )
>
> )
>
> the output i need is:
> Dogs 5
> Cats 9
>
> I need to add the total but keep just one animal if its already there. can
> someone please help? i been stuck for two days. i appreciate it.
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
>
>