I have a session of arrays named:
$_SESSION['A'];
it contains
$_SESSION['A'][0] = 'A';
$_SESSION['A'][1] = 'B';
I can unset the $_SESSION['A']; using
unset($_SESSION['A']);
it unset all the value in the array how can I unset all value stored in
$_SESSION['A'];
exept
$_SESSION['A'][0];
$_SESSION['A'][1];
I've seen this POST
which it unset all $_SESSION exept some stored in array. I used this code to unset it on array but I don't know how to used it as arrays.
$keys = array('x', 'y');
$_SESSION = array_intersect_key($_SESSION, array_flip($keys));