lp__array_is_assoc( $array )
An array helper function that checks if an array is associative (i.e. has string keys or non-sequential integer keys).
Plugin
Namespace
Launchpad
Parameters
array
$array
The array to check.
Return
bool
True if the input array is associative, false otherwise.
Source
File: \includes\lp-utility-functions.php
function lp__array_is_assoc( $array ) {
$assoc = false;
if( is_array( $array ) && ! empty( $array ) ){
if( array_keys($array) !== range(0, count($array) - 1) ) $assoc = true;
}
return $assoc;
}