Re: add item to end of (multidimensional) array
| From: | ApexEleven | Date: | Fri, 15 Oct 2004 16:33:03 +0000 |
| Subject: | Re: add item to end of (multidimensional) array | ||
| References: | 1 2 3 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-199608@lists.php.net to get a copy of this message | ||
How come you guys always go for the simplest answer? why not do something like,
$num = count($arrPt);
$arrPt[$num]['name'] = "Figntin' Bob";
$arrPt[$num]['address'] = "Under the Broad Street Bridge";
Live a little...
-Jasper
On Fri, 15 Oct 2004 09:07:43 -0500, Chris Boget <chris.boget@wild.net> wrote:
> > You mean like this...
> > $sub = array
> > (
> > 'name' => 'Ahhhhhnold',
> > 'address' => '123 Someplace Nice',
> > );
> >
> > $bigArray[] = $sub;
>
> Something else that will work is the following:
>
> $arrPt =& $Arr[];
> $arrPt['name'] = 'bob';
> $arrPt['address'] = 'wherever';
>
> thnx,
> Chris
>
>
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
>
--
<<--------------------------------------------------------
Jasper Howard - Database Administration
ApexEleven.com
530 559 0107
------------------------------------------------------->>