My function:
function SessionSet($s, $v = '') {
if (is_array($s)) {
foreach ($s as $k => $v) $_SESSION[$k] = $v;
} else {
$_SESSION[$s] = $v;
}
}
It’s possible make it work like this:
SessionSet('user_visits')++;
Just a simple increment, but don’t have any ideas how…
How about
instead?
You cannot increment the return value of a function – there’s nowhere for the incremented value to be stored.