$file_handle = fopen("title.txt", 'rb');
while (!feof($file_handle) ) {
$line_of_text = fgets($file_handle);
$stringData.= $line_of_text . "\n";
}
$stringData.= "new text document" . "\n";
fclose($file_handle);
$file_handle = fopen("title.txt" , 'w');
if (fwrite($file_handle, $stringData)){
echo "insert successfully";
}
else{
echo "not insert";
}
fclose($file_handle);
?>
为什么 output 是
new text documentnew text document
连在一起的, 但是读出来的时候却可以有 new text document
new text document 分开的呢?