Monday, August 1, 2011

PHP multidimensional array check

Today i faced with problem that array had array inside it. It means that the array is multidimensional. So i was forced to recheck the array check with function is_array to new check. Here is the code of check:


function is_multi($a) {
    $rv = array_filter($a,'is_array');
    if(count($rv)>0) return true;
    return false;
}

Source: http://stackoverflow.com/questions/145337/checking-if-array-is-multidimensional-or-not
Big thanks to Vinko Vrsalovic

No comments:

Post a Comment