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
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++;
2 matches
Mail list logo