VersionPress\Utils\ArrayUtils::isAssociative PHP 메소드

isAssociative() 공개 정적인 메소드

Returns true if the array is associative. Associative being defined as an array containing at least one string key.
public static isAssociative ( mixed $array ) : boolean
$array mixed Array is generally expected but any value may be provided (will return false)
리턴 boolean
    public static function isAssociative($array)
    {
        if (!is_array($array)) {
            return false;
        }
        return (bool) count(array_filter(array_keys($array), 'is_string'));
    }