Just a little test script to increase the number by 1 every time the page is refreshed and it works fine, but if you hold down F5 to refresh for quite a while, the number decreases and I can't work out why :/
code:
<?php
$filename = "count.txt";
$x = file_get_contents("$filename");
file_put_contents("$filename", $x);
$x = $x*1;
$y = $x+1;
$f = fopen($filename, "w");
fwrite($f, $y);
fclose($f);
echo $x;
?>