note 98841 added to function.is-array
| From: | alex00888 at gmail dot com | Date: | Sat, 10 Jul 2010 11:48:30 +0000 |
| Subject: | note 98841 added to function.is-array | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-170857@lists.php.net to get a copy of this message | ||
I think this will be better:
<?php
function is_assoc($array) {
return (is_array($array) && (count($array)==0 || 0 !== count(array_diff_key($array,
array_values($array)) )));
}
?>
----
Server IP: 69.147.83.197
Probable Submitter: 109.188.59.41
----
Manual Page -- http://www.php.net/manual/en/function.is-array.php
Edit -- https://master.php.net/note/edit/98841
Del: integrated -- https://master.php.net/note/delete/98841/integrated
Del: useless -- https://master.php.net/note/delete/98841/useless
Del: bad code -- https://master.php.net/note/delete/98841/bad+code
Del: spam -- https://master.php.net/note/delete/98841/spam
Del: non-english -- https://master.php.net/note/delete/98841/non-english
Del: in docs -- https://master.php.net/note/delete/98841/in+docs
Del: other reasons-- https://master.php.net/note/delete/98841
Reject -- https://master.php.net/note/reject/98841
Search -- https://master.php.net/manage/user-notes.php