note 77744 added to function.is-array
| From: | Michael at osu1 dot php dot net | Date: | Tue, 11 Sep 2007 19:37:14 +0000 |
| Subject: | note 77744 added to function.is-array | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-130379@lists.php.net to get a copy of this message | ||
A slight modification of what's below:
<?php
function is_assoc($array)
{
return is_array($array) && count($array) !== array_reduce(array_keys($array),
'is_assoc_callback', 0);
}
function is_assoc_callback($a, $b)
{
return $a === $b ? $a + 1 : 0;
}
?>
----
Server IP: 64.71.164.2
Probable Submitter: 128.187.0.178
----
Manual Page -- http://www.php.net/manual/en/function.is-array.php
Edit -- https://master.php.net/note/edit/77744
Del: integrated -- https://master.php.net/note/delete/77744/integrated
Del: useless -- https://master.php.net/note/delete/77744/useless
Del: bad code -- https://master.php.net/note/delete/77744/bad+code
Del: spam -- https://master.php.net/note/delete/77744/spam
Del: non-english -- https://master.php.net/note/delete/77744/non-english
Del: in docs -- https://master.php.net/note/delete/77744/in+docs
Del: other reasons-- https://master.php.net/note/delete/77744
Reject -- https://master.php.net/note/reject/77744
Search -- https://master.php.net/manage/user-notes.php