Check if PHP array is associative Technology Community › Category: PHP › Check if PHP array is associative 0 Vote Up Vote Down VietMX Staff asked 4 years ago Consider: function has_string_keys(array $array) { return count(array_filter(array_keys($array), 'is_string')) > 0; } If there is at least one string key, $array will be regarded as an associative array.