Functions::is_associative_array($arr)

Version 4

Is array with string keys

Check if value is array and it has string keys

Return value

Bool

Arguments

$arr
Value to check

Full documentation

Check if $arr is associative array:

$arr = Array( 'title' => 'Title' );
if ( is_associative_array($arr) ){
    // is true
}

$arr = Array( 'Title' );
if ( is_associative_array($arr) ){
    // is false
}