This example actually updates the file according to a date and a number; if the line contains the current date, it increments the number otherwise it adds another line with the current date.
Everyday a line is then added and a new counter is initiated.
The source code:
Notes:
- the file is automatically created if it does not exists (see writing into a file for more details);
- you need to have the necessary permissions to be able to write into a file on your server (see chmod on linux/unix).
You may wish to read additional materials from:
- http://www.php.net/manual/en/function.fgets.php
- http://www.php.net/sscanf