September 2001
Intermediate to advanced
768 pages
32h 45m
English
void unset(mixed variable, [mixed another_variable], [mixed...])
Unsets one or more variables.
Returns:
Nothing
Description:
unset() deletes one or more variables. The function returns nothing—attempting to assign its return value to a variable simply results in PHP generating a parse error. If you want to ensure that the value has been deleted, use the isset() function.
Availability:
UNIX, Windows
Version:
3+, 4+
Example:
<pre> <?php $song = array ( 'name' => 'Another Second to Be', 'band' => 'Accept', 'album' => 'Russian Roulette', 'year' => 1986 ); print "<tt>$song</tt> before calling unset:\n"; print_r ($song); // Individual array elements can be unset print "\n<tt>\$song</tt> after calling <tt>unset (\$song['year']):</tt>\n"; ... |
Read now
Unlock full access