How does PHP determine whether an array is a one-dimensional array or a two-dimensional array? what function is used? In fact, Count is sufficient
PHP Manual:
int count (mixed $var [, int $mode])-- calculates the number of cells in an array or the number of attributes in an object
If the optional mode parameter is set to Count_recursive (or 1), COUNT () counts recursively on the array. is especially useful for calculating all cells of a multidimensional array. The default value for mode is 0. Count () does not recognize infinite recursion.
<? PHP if 1 ) {' is a one-dimensional array 'Else { ' Not a one-dimensional array ';}
Explanation: Count's second parameter true will recursively count the number of arrays, if the number of recursive statistics and non-recursive recursive statistics are the same, then it must be a one-dimensional array
How to verify a two-dimensional array