Skip to content

Instantly share code, notes, and snippets.

@jeffgca
Created March 1, 2011 22:59
Show Gist options
  • Select an option

  • Save jeffgca/850084 to your computer and use it in GitHub Desktop.

Select an option

Save jeffgca/850084 to your computer and use it in GitHub Desktop.
handy function to test the associative-ness of an array in PHP.
<?php
function is_assoc($arr) {
return array_keys($arr) !== range(0, count($arr) - 1);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment