Array key problem

From: Date: Tue, 25 Feb 2003 16:37:27 +0000
Subject: Array key problem
Groups: php.db 
Request: Send a blank email to php-db+get-25913@lists.php.net to get a copy of this message
Hi! Anyone got an idea what the problem may be with the following code $test[]="a"; $test[]="b"; foreach ($test as $key=>$value) { if($key == "something") echo $key } even though theres no key in the array named "something" the code will print the key "0" Thanks

« previous php.db (#25913) next »