Skip to content

Instantly share code, notes, and snippets.

@shadowhand
Created January 31, 2009 22:54
Show Gist options
  • Save shadowhand/55693 to your computer and use it in GitHub Desktop.
Save shadowhand/55693 to your computer and use it in GitHub Desktop.
<?php defined('SYSPATH') OR die('No direct access allowed.');
class arr extends arr_Core {
public static function is_assoc(array $array)
{
// Keys of the array
$keys = array_keys($array);
// If the array keys of the keys match the keys, then the array must
// be associative.
return array_keys($keys) !== $keys;
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment