1. Home
  2. Computing & Technology
  3. PHP / MySQL

Unset () PHP Function

By Angela Bradley, About.com

Definition: Unset () is used to destroy a variable in PHP. In can be used to remove a single variable, multiple variables, or an element from an array. It is phrased as Unset ($remove).
Also Known As: Unset Variable, Destroy Variable
Examples:
<?php
// remove a single variable
unset($a);

// remove a single element in an array
unset($my_array['element']);

// remove multiple variables
unset($a, $b, $c);
?>

Explore PHP / MySQL

More from About.com

  1. Home
  2. Computing & Technology
  3. PHP / MySQL
  4. PHP Functions
  5. PHP Unset Variable - PHP Unset Function - Unset Variable

©2008 About.com, a part of The New York Times Company.

All rights reserved.