RE: [PHP] Pushing array onto array
| From: | Ford, Mike [LSS] | Date: | Mon, 04 Aug 2003 10:44:49 +0000 |
| Subject: | RE: [PHP] Pushing array onto array | ||
| Groups: | php.general | ||
| Request: | Send a blank email to php-general+get-158136@lists.php.net to get a copy of this message | ||
> -----Original Message-----
> From: Curt Zirzow [mailto:curt@zirzow.dyndns.org]
> Sent: 02 August 2003 23:07
>
> * Thus wrote Andrew Brampton (andrew@bramp.freeserve.co.uk):
> > Well I just coded up a very small example, and it pushing 1
> array into the
> > other...
> >
> > Check out: http://81.102.229.151/push.php and
> > http://81.102.229.151/push.phps
> >
> > It works exactly how it should... However really the array isn't a 2
> > dimensional one, since PHP doesn't have them, its rather a
> array of arrays
> > which is roughly the same thing (and something not to worry
> about)...
>
> A 2 demensional array is an array of arrays.
No, it isn't. A true 2-dimensional array is completely orthogonal -- anything you can do
row-wise you can automatically also do column-wise, without having to write any special
functionality. An array of arrays, by its very nature, doesn't have columns as such, so if you
want to work with, e.g. $arr[*][1] you have to have special functions to do so.
There are other differences, but in a nutshell that's essentially it.
Cheers!
Mike
---------------------------------------------------------------------
Mike Ford, Electronic Information Services Adviser,
Learning Support Services, Learning & Information Services,
JG125, James Graham Building, Leeds Metropolitan University,
Beckett Park, LEEDS, LS6 3QS, United Kingdom
Email: m.ford@lmu.ac.uk
Tel: +44 113 283 2600 extn 4730 Fax: +44 113 283 3211