Php – Detecting if an Array is Indexed or Associative

arraysassociative-arrayphp

Possible Duplicate:
PHP Arrays: A good way to check if an array is associative or sequential?

What would be the most performant way of checking if an array is associative or not in PHP?

Best Solution

If it is for the purpose of iterating through an array, to be safe you can always use foreach.