By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
455,744 Members | 1,808 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 455,744 IT Pros & Developers. It's quick & easy.

How can I get an array -n dimension size??

P: n/a
Sort of sizeof but applied to a particular array dimension.

Similar to ASP ubound(array,dimension)
Jul 17 '05 #1
Share this Question
Share on Google+
2 Replies


P: n/a
On 22 Apr 2004 23:27:44 -0700, pa*********@hotmail.com (John Pastrovick) wrote:
Sort of sizeof but applied to a particular array dimension.

Similar to ASP ubound(array,dimension)


http://php.net/array

--
Andy Hassall <an**@andyh.co.uk> / Space: disk usage analysis tool
http://www.andyh.co.uk / http://www.andyhsoftware.co.uk/space
Jul 17 '05 #2

P: n/a
"John Pastrovick" <pa*********@hotmail.com> wrote in message
news:a2*************************@posting.google.co m...
Sort of sizeof but applied to a particular array dimension.

Similar to ASP ubound(array,dimension)


It's hard to apply the concept to multidimensional PHP arrays, since they're
stored as tree structures. Take the following for example:

$a[0][3][5][2] = "Hello";
$a[1][3][8][8] = "World";

At the second dimension, you actually have 2 arrays, one belonging to $a[0]
and another to $a[1], both with 3 as the index. So should the result be 2 or
1? And of course, you can have gaps in your indices. At the third dimension,
there're only two elements, with indices 5 and 8.
Jul 17 '05 #3

This discussion thread is closed

Replies have been disabled for this discussion.