时间:2021-07-01 10:21:17 帮助过:15人阅读
1 4 5 6 7输出整个文件54 while(!feof($fp))55 $char =fgetc($fp);56 if(!feof($fp))57 echo ($char =="\n"?Bob's Auto Parts -Customer Orders 8 9 10Bob's Auto Parts
11Customer Orders
12 13 isn't double";18 echo gettype($a).'
';19 settype($a,'double');20 echo gettype($a).'
';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 //读取每行37 while (!feof($fp)){38 $order = fgets($fp,1024); //fgets()每次读取一行,遇到\n 、eof 、或者是998b结束。默认1k=1024b39 echo $order."
"; //fgetss() 和fgets()一样的功能,但是能过滤掉包含php和html的标记40 } //fgetss(resource fp,int length,string[allowable_tags]) 把不过滤的标记放在allowable_tags中41 //$order = fgetss($fp,999,",
");42 // fgetcsv($fp,1024,"\t") 意思是遇到换行43 44 /*45 读取整个文件,46 readfile("$DOCUMENT_ROOT/orders/orders.txt");47 fpassthru($fp) ; //fp是一个指针48 $filearray =file("$DOCUMENT_ROOT/orders/orders.txt") 49 //功能和readfile一样,但是每一行是字符串数组的一个元素50 */ 51 52 /*53 通过字符来