Last active
November 11, 2015 20:36
-
-
Save kjbrum/9508ce6e264084a11b5b to your computer and use it in GitHub Desktop.
Check if an array is a multidimensional array.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/** | |
* Check if an array is a multidimensional array. | |
* | |
* @param array $arr The array to check | |
* @return boolean Whether the the array is a multidimensional array or not | |
*/ | |
function is_multi_array( $x ) { | |
if( count( array_filter( $x,'is_array' ) ) > 0 ) return true; | |
return false; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment