2 /* Prototype : string sprintf(string $format [, mixed $arg1 [, mixed ...]])
3 * Description: Return a formatted string
4 * Source code: ext/standard/formatted_print.c
7 echo "*** Testing sprintf() : basic functionality - using octal format ***\n";
9 // Initialise all required variables
13 $format3 = "%o %o %o";
18 // Calling sprintf() with default arguments
19 var_dump( sprintf($format) );
21 // Calling sprintf() with two arguments
22 var_dump( sprintf($format1, $arg1) );
24 // Calling sprintf() with three arguments
25 var_dump( sprintf($format2, $arg1, $arg2) );
27 // Calling sprintf() with four arguments
28 var_dump( sprintf($format3, $arg1, $arg2, $arg3) );