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 11:29:33 +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-171029@lists.php.net to get a copy of this message | ||
On 26 November 2003 03:28, orlandopozo@icnet.com.ve contributed these pearls
of wisdom:
> Hello all mailing list, I am wondering if it exists a PHP
> built-in function to determine the numbers of dimensions of
> any type of array (indexed, and associative), thanks for any
> help, bye.
(i) All PHP arrays are associative -- some of them just happen to have
purely numeric indexes, and PHP itself handles numeric indexes slightly
specially, but that doesn't make them any less associative.
(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.
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