I know yoy can count single dimensional arrays like count(array).
What if the array is of type:
something[x][y] where x and y may not have the same count.
what does count(something) yield?
How do I just count the items in the x or y index?
print count($arr); print count($arr[0]);
So if i have :
array[x][y] and x has 6 items and y has 20
count(array) will yield 26?
I used x & y as example, suppose x and y are numerically indexed arrays and I did not know how many were in each.
1 2
array[ ][ ]
How would I find out how many items were in the first?
The second?
Why not just try it?
If $arr[x][y] x has 20 then count ($arr) will yield 20.
Note that y doesn't have to be "sqaure". I.e. $arr[0] may have ten elements, while $arr[1] may have 8.
So, count($arr[0]) will tell you how many elements $arr[0] has, while count($arr[1]) will tell you how many elements $arr[1] has. And they won't necessarily be the same.