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() : integer formats with string values ***\n";
9 // array of strings used to test the function
10 $string_values = array (
34 // various integer formats
38 "\t%d", "\n%d", "%4d",
39 "%30d", "%[0-9]", "%*d"
43 foreach($string_values as $string_value) {
44 echo "\n-- Iteration $count --\n";
46 foreach($int_formats as $format) {
47 var_dump( sprintf($format, $string_value) );