A simple helper function to determine whether or not a PHP variable is an associative array.
1 2 3 4 5 6 7 | function is_hash($var) { if (!is_array($var)) return false; return array_keys($var) !== range(0,sizeof($var)-1); } |
A simple helper function to determine whether or not a PHP variable is an associative array.
1 2 3 4 5 6 7 | function is_hash($var) { if (!is_array($var)) return false; return array_keys($var) !== range(0,sizeof($var)-1); } |
Recent Comments