PHP - Sessions and Cookies
You want to count how many times a user visits a page using sessions. Which code correctly increments the visit count each time the page loads?
<?php
// Fill in the missing part
if (isset($_SESSION['visits'])) {
$_SESSION['visits']++;
} else {
$_SESSION['visits'] = 1;
}
echo "Visit number: " . $_SESSION['visits'];
?>