Raised This Month: $ Target: $400
 0% 

sizeof() multi-dimensional arrays


  
 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
Author Message
Diegorkable
Veteran Member
Join Date: Jun 2011
Old 11-06-2011 , 18:32   sizeof() multi-dimensional arrays
Reply With Quote #1

Hey guys,

im confused about something and i want to understand something that is wierd to me now.

Lets say I declared a multi-dimensional array:

PHP Code:
new variable[100][500
Now, I want to know the length of each array in the arrays (like, there is an array of arrays, and I want to know the length of each array in the array of arrays, which is 500)

From what I know, I should do it like this:

PHP Code:
sizeof(variable[0]) 
But I get compiler errors, and I can only do:

PHP Code:
sizeof(variable
Why is that? I try to think but it's confusing, I mean, sizeof(variable) isnt supposed to give me the length of the array of arrays? which is 100. but what do i do to get the returned value of 500? (the size of each array within the array of the arrays)
__________________
My Projects:

Auto-Mix (Pug): 100%

Joined the Military (a soldier now) - Inactive
Diegorkable is offline
 


Thread Tools
Display Modes

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 On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -4. The time now is 14:18.


Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.
Theme made by Freecode