void unset ( mixed var [, mixed var [, mixed ...]] ) : unset « Data Type « PHP






void unset ( mixed var [, mixed var [, mixed ...]] )

 
The unset( ) function deletes a variable so that isset( ) will return false. Once deleted, you can recreate a variable later on in a script.
<?
    $name = "Paul";
    if (isset($name)) print "Name is set\n";
    unset($name);
    if (isset($name)) print "Name is still set\n";
?>

That would print out "Name is set", but not "Name is still set", because calling unset( ) has deleted the $name variable.
  
  








Related examples in the same category

1.Removing Session Data
2.Deleting an object
3.Using the unset() Function
4.Removing Elements
5.Removing Elements from Arrays