note 35226 deleted from ref.array by tularis
| From: | tularis@php.net | Date: | Sun, 26 Aug 2007 16:38:46 +0000 |
| Subject: | note 35226 deleted from ref.array by tularis | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-129811@lists.php.net to get a copy of this message | ||
Note Submitter: szymon at mazurek dot info
----
How to count dimensions in multi-array?
This is the way I do this:
function countdim($array) {
static $dimcount = 1;
if (is_array(reset($array))) {
$dimcount++;
$return = countdim(reset($array));
} else {
$return = $dimcount;
}
return $return;
}
This function will return int number of array dimensions.