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() : hexa formats with resource values ***\n";
9 // resource type variable
10 $fp = fopen (__FILE__
, "r");
11 $dfp = opendir ( dirname(__FILE__
) );
13 // array of resource types
14 $resource_values = array (
19 // array of hexa formats
20 $hexa_formats = array(
23 "\t%x", "\n%x", "%4x",
24 "%30x", "%[0-9A-Fa-f]", "%*x"
28 foreach($resource_values as $resource_value) {
29 echo "\n-- Iteration $count --\n";
31 foreach($hexa_formats as $format) {
32 var_dump( sprintf($format, $resource_value) );
37 // closing the resources