PHP - Sessions and Cookies
Identify the error in this code snippet:
session_start(); $_SESSION = array(); echo $_SESSION['name'];
session_start(); $_SESSION = array(); echo $_SESSION['name'];
Assigning an empty array clears all session data.
Trying to echo $_SESSION['name'] when it doesn't exist causes a PHP notice.
15+ quiz questions · All difficulty levels · Free
Free Signup - Practice All Questions