xxxxxxxxxx
<?php
// File to store the visitor count
$counterFile = 'visitor_count.txt';
// Check if the counter file exists, and if not, create it with an initial count of 0
if (!file_exists($counterFile)) {
file_put_contents($counterFile, '0');
}
// Read the current visitor count
$currentCount = intval(file_get_contents($counterFile));
// Increment the count for each visitor
$currentCount++;
// Update the counter file with the new count
file_put_contents($counterFile, strval($currentCount));
// Output the visitor count
echo "You are visitor number: " . $currentCount;
?>