I wrote a program to test the function fputs() & fgets():
<?
$fp = fopen("d:\php.doc\1.txt", "r+");
fputs($fp,"haha\n");
$out=fgets($fp,1000);
fputs($fp,"hehe\n");
$out=fgets($fp,1024);
fclose($fp);
?>
I think the result is:
haha
hehe
But the result of 1.txt is:
haha- cho "Hello!"
hehe= fopen("d:\php.doc\1.txt", "r+");
I don't know why.
thanks.