Actually, it doesn't set to "blank", but to NULL... I bet you can guess
why! It doesn't exist (null). In Java, this would throw a "null pointer
exception" (on of the reasons I love PHP! Though, if you have
error-reporting set at the right level (Notice), PHP will throw an
"Undefined index..." notice.

This is an excellent example/reason to first check for existence before
assigning...

$numbers = array('a' => 1, 'b' => 2, 'c' => 3);

$a = $numbers['a'];

$a = $numbers['d'];

$a = (isset($numbers['d'])) ? $numbers['d'] : $a;


​

_______________________________________________

UPHPU mailing list
UPHPU@uphpu.org
http://uphpu.org/mailman/listinfo/uphpu
IRC: #uphpu on irc.freenode.net

Reply via email to