1. 程式人生 > >檔案操作,一行一行讀取,中間以空格隔開

檔案操作,一行一行讀取,中間以空格隔開

$filename = 'toefl.txt';
$handle  = fopen ($filename, "r");
 
while (!feof ($handle))
{
    $buffer  = fgets($handle, 4096);

    $username = trim($buffer);
    $record=str_replace("\t","_",$username);
    $record = explode('_', $record);
}

fclose ($handle);