Checking if array is multidimensional or not?
Use count() twice; one time in default mode and one time in recursive mode. If the values match, the array is not multidimensional, as a multidimensional array would have a higher recursive count. if (count($array) == count($array, COUNT_RECURSIVE)) { echo ‘array is not multidimensional’; } else { echo ‘array is multidimensional’; } This option second … Read more