Not too difficult, read the count, then just reverse the process.
$File = "log.txt";
$Open = fopen($File, "r");
$value=fread($Open, filesize($File));
fclose($Open);
$value++;
echo "Page loaded $value times since whenever.";
$Open = fopen($File, "w");
fwrite($Open, $value);
fclose($Open);