Array key problem

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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

[Index of Archives]     [PHP Home]     [PHP Users]     [Postgresql Discussion]     [Kernel Newbies]     [Postgresql]     [Yosemite News]

  Powered by Linux