note 24939 deleted from function.is-callable by derick

From: Date: Sat, 08 Apr 2006 14:21:31 +0000
Subject: note 24939 deleted from function.is-callable by derick
References: 1  Groups: php.notes 
Request: Send a blank email to php-notes+get-107566@lists.php.net to get a copy of this message
Note Submitter: kmckay at kmckay dot ca ---- I'm using the function to determine if a posted variable is "callable". This is usefull when checking if posted variable names exist within a class. while(list($key,$value)=each($HTTP_POST_VARS)) { $tmpVar = 'return isset($' . 'this->' . $key . ');'; if(is_callable($key) && eval($tmpVar) && trim($value) != "") { $tmpSet = '$this->set' . ucfirst($key) . "('" . $value . "');"; eval($tmpSet); } }

« previous php.notes (#107566) next »