Php is the simplest file processing method.
1
4 567Bob's Auto Parts-Customer Orders8910 Bob's Auto Parts11 Customer Orders12 13
Isn' t double"; 18 echo gettype ($ ).'
'; 19 settype ($ a, 'double'); 20 echo gettype ($ ).'
'; 21 */22 23 @ $ fp = fopen ("$ DOCUMENT_ROOT/orders/orders.txt", 'RB'); 24 if (! $ Fp) {25 echo"No orders pending.26 please try again later.
"; 27 exit; 28} 29 30/* 31 isset (); 32 33 empty () 34 35 */36 // read each line 37 while (! Feof ($ fp) {38 $ order = fgets ($ fp, 1024); // each time fgets () reads a row, it ends with \ n, eof, or 998b. The default value is 1 k = 1024b39 echo $ order ."
"; // Fgetss () is the same as fgets (), but can filter out the 40 tags containing php and html} // fgetss (resource fp, int length, string [allowable_tags]) put the unfiltered tags in allowable_tags 41 // $ order = fgetss ($ fp, 999 ,",
"); 42 // fgetcsv ($ fp, 1024," \ t ") means reading the entire file with a line break of 43 44/* 45, 46 readfile ("$ DOCUMENT_ROOT/orders/orders.txt"); 47 fpassthru ($ fp ); // fp is a pointer of 48 $ filearray = file ("$ DOCUMENT_ROOT/orders/orders.txt") 49 // The function is the same as readfile, however, each row is an element of the string array 50 */51 52/* 53, and the entire file 54 while (! Feof ($ fp) 55 $ char = fgetc ($ fp); 56 if (! Feof ($ fp) 57 echo ($ char = "\ n "?
: $ Char); 58 */59 // fread ($ fp, int length) read arbitrary length, or to eof 60 61/* 62 file_exists ("$ DOCUMENT_ROOT/orders/orders.txt"); 63 filesize (); 64 unlink ("$ DOCUMENT_ROOT/orders/orders.txt ") // delete a file 65 66 rewind ($ fp); // repeat the start pointer 67 fseek ($ fp); // locate the position of 68 ftell ($ fp ); // display position 69 70 71 */72 73?> 74