Re: expand array into function arguments?

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Richard Lynch wrote:

> On Wed, May 11, 2005 12:13 pm, Christopher J. Bottaro said:
>> 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?
> 
> You mean call a user function with an array for the parameters?
> 
> Didja search the PHP website?

Yes, but sometimes its hard to search unless you know exactly what you are
looking for.  I was looking for a language construct, I wasn't really
expecting a function.

> You should have found this:
> 
> http://php.net/call_user_func_array

That its, perfect.  Thank you.

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[Index of Archives]     [PHP Home]     [Apache Users]     [PHP on Windows]     [Kernel Newbies]     [PHP Install]     [PHP Classes]     [Pear]     [Postgresql]     [Postgresql PHP]     [PHP on Windows]     [PHP Database Programming]     [PHP SOAP]

  Powered by Linux