1--TEST--
2Test fprintf() function (variation - 4)
3--FILE--
4<?php
5
6$char_variation = array( 'a', "a", 67, -67, 99 );
7
8/* creating dumping file */
9$data_file = __DIR__ . '/fprintf_variation_004.txt';
10if (!($fp = fopen($data_file, 'wt')))
11   return;
12
13/* char type variations */
14fprintf($fp, "\n*** Testing fprintf() for chars ***\n");
15foreach( $char_variation as $char ) {
16  fprintf( $fp, "\n");
17  fprintf( $fp,"%c", $char );
18}
19
20fclose($fp);
21
22print_r(file_get_contents($data_file));
23echo "\nDone";
24
25unlink($data_file);
26
27?>
28--EXPECTF--
29*** Testing fprintf() for chars ***
30
313233C
34%s
35c
36Done
37