468,248 Members | 1,495 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 468,248 developers. It's quick & easy.

Re: getting parameters to send then to another function

>My goal is to have a unique function with undeterminated number of
parameters witch return the sprintf result.

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.

Sep 23 '08 #1
0 1280

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

11 posts views Thread by Simon Wigzell | last post: by
7 posts views Thread by Aaron Gray | last post: by
reply views Thread by FutureShock | last post: by
reply views Thread by kermitthefrogpy | last post: by
reply views Thread by zattat | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.