Do you have a question? Post it now! No Registration Necessary. Now with pictures!
- Posted on
September 23, 2008, 12:14 pm
rate this thread
Hi, I'm trying something...
My goal is to have a unique function with undeterminated number of
parameters witch return the sprintf result.
print test("key", "key2");
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"...
but I don't know how to send the test() parameter's into the sprintf's ones
Do you understand ? ansd do you have any solution ? thanks.
Re: getting parameters to send then to another function
Your best bet would probably be to pass the function an array of your
variables and then extract them inside the function for use.
Remember that you have to pass the same number of parameters into the
function as what it was designed for.
Your function above would fail as the $key2 would not make it inside the
- Michael Fesser
September 23, 2008, 12:49 pm