Re: Howto re-pass arguments?
- From: zapzap <zapzap@xxxxxxxxxxxxx>
- Date: Sun, 21 Oct 2007 09:22:52 +0200
J.O. Aho wrote:
zapzap wrote:
Hello :-)function b($array) {
Is it possible to pass all arguments to another function?
function A()
{
B(func_get_args());
}
function B()
{
var_dump(func_get_args());
}
I dont know how many arguments will come for A, and i want
A to handle them transparent and pass all to B.
Now i'm doing this with func_get_args but I get
an array ob B's input. original arguments would be
better. Is this possible in any way?
if(is_array($array)) {
foreach($array AS $var) {
var_dump($var);
}
} else {
var_dump($array);
}
}
No no no ;-) My fault, see this:
//
function A()
{
B(); // THIS NEEDS TO BE CHANGED PROBLY :>
}
//
function B()
{
var_dump(func_get_args());
}
So, I will NEVER call B directly, i'll always call A
an A will call B for me.
B is loaded/generated dynamicaly, so one time B requires
2 arguments, sometimes 5 arguments. As i said i will
only call A, sometimes A($var1,$var2,$var3), other
A($var1). How can I tell A to pass all its
arguments to B - WITHOUT having them as an array (as result
of fun_get_args in my previous posting).
I hope this is clear now ;-) sorry for my english
.
- Follow-Ups:
- Re: Howto re-pass arguments?
- From: J.O. Aho
- Re: Howto re-pass arguments?
- References:
- Howto re-pass arguments?
- From: zapzap
- Re: Howto re-pass arguments?
- From: J.O. Aho
- Howto re-pass arguments?
- Prev by Date: Re: Howto re-pass arguments?
- Next by Date: Re: Howto re-pass arguments?
- Previous by thread: Re: Howto re-pass arguments?
- Next by thread: Re: Howto re-pass arguments?
- Index(es):
Relevant Pages
|