Re: array of array



Bob Bedford wrote:

> > $bigarray["X"][] = $value1;
> > $bigarray["X"][] = $value2;
> > ...
> > $bigarray["Y"][] = $value5;
> Does it create a new element in the $bigarray["X"] ?
> I mean then I have $bigarray["X"][0] == $value1;
> $bigarray["X"][1] == $value2;

Yes. As mentioned in Ewoud Dronkert's reply, this is a better way of
doing it rather than using array_push(). Even the PHP manual mentions
this.

$bigarray[] = $value1;
=>
$bigarray[0] == $value1;

$bigarray[0][] = $value2;
=>
$bigarray[0][0] == $value2;

--
Kim André Akerø
- kimandre@xxxxxxxxxxxxxxxxxx
(remove NOSPAM to contact me directly)
.



Relevant Pages

  • Re: include perl progress bar
    ... Bob Bedford wrote: ... side scripting JavaScript or Flash. ... Email: rrjanbiah-at-Y!com Blog: http://rajeshanbiah.blogspot.com/ ... Prev by Date: ...
    (comp.lang.php)
  • Re: A puzzle about leading zeros
    ... Thanks all, problem solved, used a variation on Ewoud Dronkert's ... suggestion. ... TheTeapot ... Prev by Date: ...
    (comp.lang.php)
  • Re: Dutch Rowing DVD
    ... Justus ... > able to grab next week sometime. ... Prev by Date: ...
    (rec.sport.rowing)
  • Re: simple loop? help
    ... Bob Bedford wrote: ... > I do probably need a good coffee, but I can't find out a simple way to do ... Prev by Date: ...
    (comp.lang.php)
  • Re: Juicing at Worlds Gifu
    ... Thanks Ewoud and J for that - it all seems a little clearer now. ... Rob. ... Prev by Date: ...
    (rec.sport.rowing)