note 44012 added to function.array-key-exists

From: Date: Mon, 12 Jul 2004 15:09:57 +0000
Subject: note 44012 added to function.array-key-exists
Groups: php.notes 
Request: Send a blank email to php-notes+get-73100@lists.php.net to get a copy of this message
Be careful : array_key_exists($key, $array) is _NOT_ equivalent to isset($array($key)) Example : If $array is a database row populated with a mysql_fetch_array($res,MYSQL_ASSOC), and the database field 'key' has a NULL value (returned by the database), $array['key'] will exist with a value set to NULL. isset( $array['key']) will be FALSE; but array_key_exists('key', $array) will be TRUE; HTH Pascal ---- Manual Page -- http://www.php.net/manual/en/function.array-key-exists.php Edit -- http://master.php.net/manage/user-notes.php?action=edit+44012 Delete -- http://master.php.net/manage/user-notes.php?action=delete+44012&report=yes Reject -- http://master.php.net/manage/user-notes.php?action=reject+44012&report=yes Search -- http://master.php.net/manage/user-notes.php

« previous php.notes (#73100) next »