Afficher un message
Vieux 21/10/2007, 08h11   #2
J.O. Aho
Aucun Avatar
 
Messages: n/a
Hébergeur:
Par défaut Re: Howto re-pass arguments?

zapzap wrote:
> Hello :-)
>
> 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?


function b($array) {
if(is_array($array)) {
foreach($array AS $var) {
var_dump($var);
}
} else {
var_dump($array);
}
}


--

//Aho
  Réponse avec citation
 
Page generated in 0,04562 seconds with 9 queries