Re: getting parameters to send then to another function

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Michael Fesser

    Re: getting parameters to send then to another function

    ..oO(Newsgroups )
    >My goal is to have a unique function with undeterminated number of
    >parameters witch return the sprintf result.
    >
    ><?php
    >print test("key", "key2");
    >function test($k)
    >{
    return sprintf("test %s %s", $k);
    >}
    >?>
    >
    >So, in this case, when we are calling test() function, we need 2 parameters
    >because sprintf require 2 "%s"...
    Why sprintf()? Why not simply implode() all parameters?
    >but I don't know how to send the test() parameter's into the sprintf's ones
    >...
    Have a look at func_get_args() and the like.

    Micha
Working...