note 106077 deleted from function.is-array by danbrown
| From: | danbrown@php.net | Date: | Mon, 10 Oct 2011 15:47:51 +0000 |
| Subject: | note 106077 deleted from function.is-array by danbrown | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-183772@lists.php.net to get a copy of this message | ||
Note Submitter: Alex
----
magentix your associative array with empty check doesn't work, you need to change:
function is_assoc ($arr) {
return (is_array($arr) && (!count($arr) ||
count(array_filter(array_keys($arr),'is_string')) == count($arr)));
}
to
function is_assoc ($arr) {
return (is_array($arr) && (count($arr) &&
count(array_filter(array_keys($arr),'is_string')) == count($arr)));
}