note 14680 added to function.isset.php
| From: | kmcmSTUPIDBOT at bigfoot dot com | Date: | Thu, 09 Aug 2001 01:24:37 +0000 |
| Subject: | note 14680 added to function.isset.php | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-16499@lists.php.net to get a copy of this message | ||
it seems that isset() won't test each index point in an array; it will only test the array as a
whole.
i.e.
//this doesn't work if one of the indexes is filled:
for ($count = 0; $count < 5; ++$count) {
if (isset($some_array[$count])) {
print "\nsome_array[$count] is filled<br>";
}
}
//using !empty() does work to test each index point:
for ($count = 0; $count < 5; ++$count) {
if (!empty($some_array[$count])) {
print "\nsome_array[$count] is filled<br>";
}
}
hmmm not sure why.
http://www.php.net/manual/en/function.isset.php