Check array is associative

Submitted by:David Villa

Date added:19 February, 2013

Category:PHP

PHP is_assoc_array function to check if given array is associative or not

Tags: array

Code Snippet:

function is_assoc_array($array)
{
if(is_array($array) && !is_numeric(array_shift(array_keys($array))))
{
return true;
}
return false;
}
 
 

Comments