[PHP] How to get count of dimensions in multi array?

2002-09-23 Thread Stefan
Hello, I´m trying to figer out how to get the number och dimensions of a array.. It isn´t the problem to get the count of elements with count(), it´s the number of dimensions i am stuck at :( Any tips would be appreciated. Best regards, Stefan -- PHP General Mailing List

Fw: [PHP] How to get count of dimensions in multi array?

2002-09-23 Thread Kevin Stone
Here.. I wrote this simple recursive function for a project a while back. Enjoy.. ? echo matrixdepth($myarray); function matrixdepth($array, $depth = 1) { foreach ($array as $key = $val) { if (is_array($array[$key])) { $depth++;