What is the difference between a normal counter and a counter with reload lock in PHP?

A normal counter in PHP simply increments a value each time it is called, while a counter with reload lock prevents the counter from incrementing if the page is refreshed or reloaded. This can be useful in scenarios where you want to prevent multiple submissions or actions from occurring when a page is refreshed.

// Counter with reload lock in PHP
session_start();

if (!isset($_SESSION['counter'])) {
    $_SESSION['counter'] = 1;
} else {
    if (!isset($_SESSION['reloaded'])) {
        $_SESSION['counter']++;
        $_SESSION['reloaded'] = true;
    }
}

echo "Counter: " . $_SESSION['counter'];