我的代碼生成該文件的一些problems.The以前的內容越來越overwrited如何寫一個PHP文件沒有得到它覆蓋
<?php
$g=fopen("lop.txt","r");
$m=fgets($g);
echo $m;
fclose($g);
$j="tendoeschate";
$b=fopen("lop.txt","w");
$p=fwrite($b,$j);
$t=fgets($b);
echo $t;
?>
在此我以前的內容
,當我追加新是越來越overwrited內容請幫忙
因此,在附加模式('a')而不是簡單寫入('w')並閱讀[DOCS](http://www.php.net/manual/en/function.fopen.php)未來 –
http://in1.php.net/manual/en/function.fopen.php – Vagabond
檢查了這一點。 http://stackoverflow.com/questions/103593/using-php-how-to-insert-text-without-overwriting-to-the-beginning-of-a-text-fil – kjames