Help | Site Map
Connecting Tech Pros Worldwide
 
 
LinkBack Thread Tools
  #1  
Old July 17th, 2005, 05:56 AM
John Pastrovick
Guest
 
Posts: n/a
Default How can I get an array -n dimension size??

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
Default 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
Default 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.


 

Bookmarks

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are Off
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

What is Bytes?

We are a network of experts and professionals in IT and software development that help one another with answers to tough questions and share insights. Get the best answers to your questions from over network members.
Post your question now . . .
It's fast and it's free

Popular Articles