Connecting Tech Pros Worldwide Help | Site Map

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

  #1  
Old July 17th, 2005, 05:56 AM
John Pastrovick
Guest
 
Posts: n/a
Sort of sizeof but applied to a particular array dimension.

Similar to ASP ubound(array,dimension)
  #2  
Old July 17th, 2005, 05:57 AM
Andy Hassall
Guest
 
Posts: n/a

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


On 22 Apr 2004 23:27:44 -0700, pastrovic2k@hotmail.com (John Pastrovick) wrote:
[color=blue]
>Sort of sizeof but applied to a particular array dimension.
>
>Similar to ASP ubound(array,dimension)[/color]

http://php.net/array

--
Andy Hassall <andy@andyh.co.uk> / Space: disk usage analysis tool
http://www.andyh.co.uk / http://www.andyhsoftware.co.uk/space
  #3  
Old July 17th, 2005, 05:57 AM
Chung Leong
Guest
 
Posts: n/a

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


"John Pastrovick" <pastrovic2k@hotmail.com> wrote in message
news:a21852f1.0404222227.1b57508@posting.google.co m...[color=blue]
> Sort of sizeof but applied to a particular array dimension.
>
> Similar to ASP ubound(array,dimension)[/color]

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.


Closed Thread


Similar Threads
Thread Thread Starter Forum Replies Last Post
Find the size of an array arnuld answers 24 November 9th, 2008 01:05 PM
How to get an array of table data into multiple text box elements jonniethecodeprince answers 3 May 28th, 2007 11:39 AM
ARRAY SIZE TOO LARGE shreesh answers 11 September 1st, 2006 10:55 PM
How to convert integer to string array without specify array size? henrytcy@gmail.com answers 7 December 8th, 2005 06:15 AM
files and directories into an array of arrays hokieghal99 answers 2 November 13th, 2005 09:53 PM