note 98159 deleted from function.is-array by visualmind
| From: | visualmind@php.net | Date: | Sat, 29 May 2010 09:25:14 +0000 |
| Subject: | note 98159 deleted from function.is-array by visualmind | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-169705@lists.php.net to get a copy of this message | ||
Note Submitter: hperrin at gmail dot com
----
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';
?>