note 73683 added to function.is-array
| From: | bcuffley at netarus dot com | Date: | Tue, 06 Mar 2007 14:42:58 +0000 |
| Subject: | note 73683 added to function.is-array | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-124157@lists.php.net to get a copy of this message | ||
pardon my newbiness, but how about:
function is_seq_array( $php_val ) {
return is_array($php_val) && ($php_val === array_values($php_val);
}
this is taking for granted that array_values would return the "same" object and not a
copy, which it currently does for indexed arrays. If you don't like this assumption, just
compare the arrays by values.
----
Server IP: 216.194.113.175
Probable Submitter: 70.168.213.76
----
Manual Page -- http://www.php.net/manual/en/function.is-array.php
Edit -- https://master.php.net/note/edit/73683
Del: integrated -- https://master.php.net/note/delete/73683/integrated
Del: useless -- https://master.php.net/note/delete/73683/useless
Del: bad code -- https://master.php.net/note/delete/73683/bad+code
Del: spam -- https://master.php.net/note/delete/73683/spam
Del: non-english -- https://master.php.net/note/delete/73683/non-english
Del: in docs -- https://master.php.net/note/delete/73683/in+docs
Del: other reasons-- https://master.php.net/note/delete/73683
Reject -- https://master.php.net/note/reject/73683
Search -- https://master.php.net/manage/user-notes.php