note 77847 deleted from function.array-key-exists by nlopess

From: Date: Sat, 15 Sep 2007 19:10:23 +0000
Subject: note 77847 deleted from function.array-key-exists by nlopess
References: 1  Groups: php.notes 
Request: Send a blank email to php-notes+get-130524@lists.php.net to get a copy of this message
Note Submitter: diogoshaw at gmail dot com ---- this function very good to use if you need to verify many variables: <?php function array_key_exists_r($keys, $search_r) { $keys_r = split('\|',$keys); foreach($keys_r as $key) if(!array_key_exists($key,$search_r)) return false; return true; } ?> e.g. <?php if(array_key_exists_r('login|user|passwd',$_GET)) { // login } else { // other } ?> works for me, enjoy. dg shaw.

« previous php.notes (#130524) next »