note 24939 added to function.is-callable
| From: | kmckay at kmckay dot ca | Date: | Thu, 05 Sep 2002 14:18:43 +0000 |
| Subject: | note 24939 added to function.is-callable | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-36167@lists.php.net to get a copy of this message | ||
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);
}
}
--
http://www.php.net/manual/en/function.is-callable.php
http://master.php.net/manage/user-notes.php?action=edit+24939
http://master.php.net/manage/user-notes.php?action=delete+24939
http://master.php.net/manage/user-notes.php?action=reject+24939