PHP - Sessions and Cookies
How can you safely remove a specific session variable named
cart without destroying the entire session?cart without destroying the entire session?Using unset() removes a single key from the $_SESSION array.
session_destroy() ends the whole session, $_SESSION = array() clears all variables, and delete is invalid syntax.
15+ quiz questions · All difficulty levels · Free
Free Signup - Practice All Questions