$filename = 'check.txt';
$fp = fopen($filename, "a+");
$string = "$url\n";
$write = fputs($fp, $string);
fclose($fp);
I have a file "check.txt" that checks for updates on my site. When I run it it updates the file however, I dont need to keep the information on there. I would like for it to open the "check.txt" file and overwrite all of it everytime instead of adding on to it.
For example when I run this script it will do the following to check.txt
9515
9785
9784
9779
9783
9780
9778
9776
9774
9775
9773
9771
9769
9763
9764
When I run it again it will display
9515
9785
9784
9779
9783
9780
9778
9776
9774
9775
9773
9771
9769
9763
9764
9515
9785
9784
9779
9783
9780
9778
9776
9774
9775
9773
9771
9769
9763
9764
I dont need to add to the txt file everytime, instead just everytime I run it keep that data. Hopefully that makes sense and someone can help out...
Thanks