Removing Variables

You can also remove information from a variable. You can use the following
statement:

$age = __;

This takes the information out of the variable $age. It now has no value. This
does not mean that $age is set to 0. It means that $age is not storing any
information. Technically, it means that $age is storing a string of zero characters.
If you echo it, you get no error message or notice; it just echoes nothing,
a blank.

You can go even further and uncreate the variable by using this statement:

unset($age);

After this statement, the variable $age no longer exists. If you try to echo it,
you get an “undefined variable” notice. You can unset more than one variable
at once, as follows:

unset($age,$name,$address);

Leave a Comment