note 33202 added to function.array-key-exists

From: Date: Thu, 19 Jun 2003 02:58:58 +0000
Subject: note 33202 added to function.array-key-exists
Groups: php.notes 
Request: Send a blank email to php-notes+get-50613@lists.php.net to get a copy of this message
If you have an array with 2 indexes, you need to do a double test with the array_key_exists: $MyArray = array("f1" => array("i1", "i2", "i3"), "f2" => array("i1", "i2", "i3")) if(array_key_exists("f1", $MyArray) //return true if(array_key_exists("i1", $MyArray["f1"]) //return true print("The pair key ["f1"]["i1"] exist in $MyArray"); ---- Manual Page -- http://www.php.net/manual/en/function.array-key-exists.php Edit Note -- http://master.php.net/manage/user-notes.php?action=edit+33202 Delete Note -- http://master.php.net/manage/user-notes.php?action=delete+33202&report=yes Reject Note -- http://master.php.net/manage/user-notes.php?action=reject+33202&report=yes

« previous php.notes (#50613) next »