note 73579 added to function.range
| From: | m0sh3 at hotmail dot com | Date: | Fri, 02 Mar 2007 01:46:05 +0000 |
| Subject: | note 73579 added to function.range | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-124004@lists.php.net to get a copy of this message | ||
Here's how i use it to check if array is associative or not:
<?php
if (array_keys($arr)===range(0, sizeof($arr)-1)) {
// not associative array
} else {
// associative array
}
?>
----
Server IP: 69.147.83.197
Probable Submitter: 72.54.247.138
----
Manual Page -- http://www.php.net/manual/en/function.range.php
Edit -- https://master.php.net/note/edit/73579
Del: integrated -- https://master.php.net/note/delete/73579/integrated
Del: useless -- https://master.php.net/note/delete/73579/useless
Del: bad code -- https://master.php.net/note/delete/73579/bad+code
Del: spam -- https://master.php.net/note/delete/73579/spam
Del: non-english -- https://master.php.net/note/delete/73579/non-english
Del: in docs -- https://master.php.net/note/delete/73579/in+docs
Del: other reasons-- https://master.php.net/note/delete/73579
Reject -- https://master.php.net/note/reject/73579
Search -- https://master.php.net/manage/user-notes.php