expand array into function arguments?
| From: | Christopher J. Bottaro | Date: | Wed, 11 May 2005 19:13:01 +0000 |
| Subject: | expand array into function arguments? | ||
| Groups: | php.general | ||
| Request: | Send a blank email to php-general+get-214966@lists.php.net to get a copy of this message | ||
You can do this in Python:
<code>
def myFunc(arg1, arg2, arg):
#do something
myList = [1, "arg", 5]
myFunc(*myList) # calls myFunc(1, "arg", 2)
<code>
Can that be done in PHP, and if so, how?
Thanks for the help.