wolves Posted September 28, 2007 Share Posted September 28, 2007 Hi <?php function showmessage($key,$args) { //args = array with arguments to sprinf $messages = array( 'this is a test %s %s %s continue testing %s', 'this is other teste %s' ); echo sprintf($messages[$key],$args); //I cant use array args... //I need arg1, arg2, arg3 // how cant I do it? my messages have different number of arguments.... } ?> tks.. Quote Link to comment https://forums.phpfreaks.com/topic/71042-sprintf-arguments/ Share on other sites More sharing options...
darkfreaks Posted September 28, 2007 Share Posted September 28, 2007 you need to use vsprintf if you want to array arguements Quote Link to comment https://forums.phpfreaks.com/topic/71042-sprintf-arguments/#findComment-357182 Share on other sites More sharing options...
wolves Posted September 28, 2007 Author Share Posted September 28, 2007 tks man!! Quote Link to comment https://forums.phpfreaks.com/topic/71042-sprintf-arguments/#findComment-357186 Share on other sites More sharing options...
darkfreaks Posted September 28, 2007 Share Posted September 28, 2007 your welcome hit topic solved if its fixed Quote Link to comment https://forums.phpfreaks.com/topic/71042-sprintf-arguments/#findComment-357187 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.