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.. 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 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!! 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 Link to comment https://forums.phpfreaks.com/topic/71042-sprintf-arguments/#findComment-357187 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.