Examveda
Examveda

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']);
?>

A. Username now set to: nachi

B. Username now set to: System

C. Username now set to:

D. Error

Answer: Option C

Solution(By Examveda Team)

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

This Question Belongs to PHP >> HTML Forms Handling

Join The Discussion

Related Questions on HTML Forms Handling