note 30618 added to function.func-get-args
| From: | mark at manngo dot net | Date: | Mon, 24 Mar 2003 05:13:36 +0000 |
| Subject: | note 30618 added to function.func-get-args | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-45715@lists.php.net to get a copy of this message | ||
You can also fake named arguments using eval:
function test()
{ foreach (func_get_args() as $k=>$arg) eval ("\$$arg;");
echo "$a plus $b gives ".($a+$b);
}
test("a=3","b=4");
--
http://www.php.net/manual/en/function.func-get-args.php
http://master.php.net/manage/user-notes.php?action=edit+30618
http://master.php.net/manage/user-notes.php?action=delete+30618
http://master.php.net/manage/user-notes.php?action=reject+30618