<?php $visit = 1; if(file_exists("counter.txt")) { $fp = fopen("counter.txt", "r"); $visit = fread($fp, 4); $visit = $visit + 1; } $fp = fopen("counter.txt", "w"); fwrite($fp, $visit); echo "Total Site Visits: " . $visit; fclose($fp);
← Test Doubles (Mocks and Stubs) php mysqli affected rows returns 0 when it should return a positive integer →