RE: [PHP] Is there a php built-in function to determine the numbe r of dimensions of the array?
| From: | Ford, Mike [LSS] | Date: | Wed, 26 Nov 2003 13:22:54 +0000 |
| Subject: | RE: [PHP] Is there a php built-in function to determine the numbe r of dimensions of the array? | ||
| Groups: | php.general | ||
| Request: | Send a blank email to php-general+get-171054@lists.php.net to get a copy of this message | ||
On 26 November 2003 13:09, Jay Blanchard contributed these pearls of wisdom:
> [snip]
> (ii) All PHP arrays are 1-dimensional. Some elements of an
> array may themselves contain arrays, but that only makes them
> nested arrays, not multi-dimensional. If what you want to
> know is the deepest level of nesting, then, no, I don't
> believe there's a built-in
> function for this.
> [/snip]
>
> From http://us3.php.net/manual/en/language.types.array.php
> here is an example of a multi-dimensional array
Just because they *call* them multi-dimensional doesn't *make* them true multi-dimensional
arrays -- they're still *nested* 1-dimensional arrays. Both types have advantages and
disadvantages, but they are not the same thing.
I think I've commented on this (mis)use of the term "multi-dimensional" before, but
so far it looks like I haven't convinced enough people it's worth changing.
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@leedsmet.ac.uk
Tel: +44 113 283 2600 extn 4730 Fax: +44 113 283 3211