原帖由 宅男-兜着走 于 2009-7-29 09:59 PM 发表
<?PHP
$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 分开的呢?
欢迎光临 JBTALKS.CC (https://mobile.jbtalks.cc/) | Powered by Discuz! X2.5 |