Hi,
I need help with arrays.
How do I get the size out of a multidimensional array?
print_r($NAV);
produces
Array ( [1] => Array ( [1] => Nav 1 [2] => Nav 1.1 [3] => Nav 1.2 ) [2] => Array ( [1] => Nav 2 ) [3] => Array ( [1] => Nav 3 [2] => Nav 3.1 ) )
Or maybe cleaner this way:
$NAV[1][1] = "Nav 1";
$NAV[1][2] = "Nav 1.1";
$NAV[1][3] = "Nav 1.2";
$NAV[2][1] = "Nav 2";
$NAV[1][2] = "Nav 2.1";
$NAV[3][1] = "Nav 3";
$NAV[3][2] = "Nav 3.1";
$NAV[3][3] = "Nav 3.2";
$NAV[3][4] = "Nav 3.3";
In the above array I need to first find out the depth of the main array, i.e the number 3. I can then use the count function on each sub array.