?
What will be the output of the following PHP code? Say your previous session username was nachi.
What will be the output of the following PHP code? Say your previous session username was nachi.
<?php
unset($_SESSION['username']);
printf("Username now set to: %s", $_SESSION['username']);
?>
<?php
unset($_SESSION['username']);
printf("Username now set to: %s", $_SESSION['username']);
?>
Answer & Solution
Correct Answer:
Option
C
To delete the session variable ‘username’ we use the unset() function.
Join the Discussion
Login to post a comment or share your explanation.
Login