note 14680 deleted from function.isset by sniper

From: Date: Mon, 06 Oct 2003 03:00:10 +0000
Subject: note 14680 deleted from function.isset by sniper
References: 1  Groups: php.notes 
Request: Send a blank email to php-notes+get-57870@lists.php.net to get a copy of this message
Note Submitter: kmcmSTUPIDBOT@bigfoot.com ---- 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.

« previous php.notes (#57870) next »