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
.



Relevant Pages

  • Re: Howto re-pass arguments?
    ... zapzap wrote: ... I dont know how many arguments will come for A, ... an array ob B's input. ... No no no;-) My fault, ...
    (alt.php)
  • Re: Rather large MSIE-hole
    ... Im not sure who else has looked at this, but I dont believe its possible ... to run programs with arguments using this vuln. ... >> If this is confirmed, could this array by changed to equal, erm...let's ... >> var programName=new Array( ...
    (Vuln-Dev)
  • Re: Change var name in a loop
    ... I want to run a for loop from 0 to 5. ... I'm doing some computation inside the loop and I want the result to go to the var according the loop. ... I dont want the result in an array or matrix because the result is a matrix. ...
    (comp.soft-sys.matlab)
  • Change var name in a loop
    ... I want to run a for loop from 0 to 5. ... I'm doing some computation inside the loop and I want the result to go to the var according the loop. ... I dont want the result in an array or matrix because the result is a matrix. ...
    (comp.soft-sys.matlab)
  • Re: PHP-like Array/Hash creation in Ruby
    ... but the autogrowing is limited to the last dimension. ... i dont have constant size of elements that could be added in just one ... want to store them in a 3 dimensional array. ... I do like Ruby very much from the first looks ...
    (comp.lang.ruby)