3 * Prototype: array file ( string filename [,int use-include_path [,resource context]] );
4 * Description: Reads entire file into an array
5 * Returns the file in an array
7 require(dirname(__FILE__
) . '/file.inc');
8 $file_path = dirname(__FILE__
);
9 echo "*** Testing file() with basic types of files ***\n";
10 $filetypes = array("numeric", "text", "empty", "text_with_new_line");
12 foreach( $filetypes as $type ) {
13 create_files($file_path, 1, $type, 0755, 100, "w", "file_basic", 1, "byte");
14 print_r( file($file_path."/file_basic1.tmp") );
15 delete_files($file_path, 1, "file_basic");
18 echo "*** Testing for return type of file() function ***\n";
19 foreach( $filetypes as $type ) {
20 create_files($file_path, 1, $type, 0755, 1, "w", "file_basic");
21 $ret_arr = file($file_path."/file_basic1.tmp");
22 var_dump( is_array($ret_arr) );
23 delete_files($file_path, 1, "file_basic");
26 echo "\n--- Done ---";