note 98159 added to function.is-array
| From: | hperrinatgmaildotcom at osu1 dot php dot net | Date: | Fri, 28 May 2010 18:10:54 +0000 |
| Subject: | note 98159 added to function.is-array | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-169700@lists.php.net to get a copy of this message | ||
Regarding my previous post:
For checking whether a value is not an array, it seems to be better to use !== in some cases.
I'm checking an array member, and it works when using !== but not ! ... ===.
So use:
<?php
if ((array) $test[0] !== $test[0])
echo 'it\'s not an array';
?>
Instead of:
<?php
if (!(array) $test[0] === $test[0])
echo 'it\'s not an array';
?>
----
Server IP: 69.147.83.197
Probable Submitter: 65.44.194.66
----
Manual Page -- http://www.php.net/manual/en/function.is-array.php
Edit -- https://master.php.net/note/edit/98159
Del: integrated -- https://master.php.net/note/delete/98159/integrated
Del: useless -- https://master.php.net/note/delete/98159/useless
Del: bad code -- https://master.php.net/note/delete/98159/bad+code
Del: spam -- https://master.php.net/note/delete/98159/spam
Del: non-english -- https://master.php.net/note/delete/98159/non-english
Del: in docs -- https://master.php.net/note/delete/98159/in+docs
Del: other reasons-- https://master.php.net/note/delete/98159
Reject -- https://master.php.net/note/reject/98159
Search -- https://master.php.net/manage/user-notes.php