Home » PHP » PHP Sessions » Question
  1. What will be the output of the following PHP code? Say your previous session username was Manjesh.
    unset($_SESSION['username']);
    printf("Username now set to: %s", $_SESSION['username']);
    1. Username now set to: System
    2. Username now set to: Manjesh
    3. Error
    4. Username now set to:
    5. None of these
Correct Option: D

To delete the session variable ‘username’ we use the unset() function.



Your comments will be displayed only after manual approval.