Jump to content

Sprintf arguments


wolves

Recommended Posts

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

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.