Re: Howto re-pass arguments?



Also sprach zapzap:

Is it possible to pass all arguments to another function?

Yes: http://de2.php.net/call_user_func_array.

function A()
{
$tmp = func_get_args();
return call_user_func_array( 'B', $tmp );
}

function B() { /* do something */ }

BTW, you cannot pass func_get_args() directly as a parameter to
call_user_func_array(), as PHP will get confused and report an error.
Therefore, it is necessary to go via the $tmp variable.

Greetings,
Thomas

--
C'est pas parce qu'ils sont nombreux a avoir tort qu'ils ont raison!
(Coluche)


.


Quantcast