I have a single webpage and i would like to track how many times it\'s visited without using a database.
I thought about XML, updating a file every time a user visit
The following works beautifully except for the large file size for too many visits.
file_put_contents('counter.txt', '1', FILE_APPEND);
echo 'Hi, Page served ' . filesize('counter.txt') . ' times!
';
However, after the file reaches 1000 or 1000000, simply create another file which counts that unit as well. Inelegance of the large size is matched by the performance that does not require locking.