也許我們可以這樣
<?php
/**
?* Created by PhpStorm.
?* User: leifeng
?* Date: 2018/8/8
?* Time: 15:52
?*/
?
?//自動創(chuàng)建test文件
$document_root = $_SERVER['DOCUMENT_ROOT'];
echo $document_root.'<br>';
$fp = fopen("$document_root/test.txt",'wb');
$str = "this is a test file.\r\n";
fwrite($fp,$str,strlen($str));
fclose($fp);
$fp = fopen("$document_root/test.txt",'rb');
while (!feof($fp)){
? ? $order = fgets($fp);//讀取一行
? ? echo "$order";
}
fclose($fp);
2019-02-25
tql
2018-08-16
o(* ̄︶ ̄*)o