Working with multi arrays
Date: 12/30/08
(PHP Community) Keywords: no keywords
Is there a way to tell the maximum 'depth' of nested arrays? (as opposed to how many elements are in the array, which count() returns).
$array = array(1,2,3); // this has no nested arrays
$array = array(array(1,2,3), array(4,5,6), array(7,8,9)); // this has several one-level nested arrays, so the max is 1.
$array = array(array(array('xyz'),2,3), 'a', 'b'); // this has a two-level nested array - so the max is 2.
Clear as mud? :o)
Source: http://community.livejournal.com/php/651806.html