1. Technology
You can opt-out at any time. Please refer to our privacy policy for contact information.

Unset () PHP Function

By

Top Related Searches
  • array element
  • unset
  • variables
  • lt
  • 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); 
     ?> 

     

    Related Video
    Basic PHP Syntax
    Using PHP With HTML
    1. About.com
    2. Technology
    3. PHP / MySQL
    4. PHP Functions
    5. Unset () PHP Function

    ©2014 About.com. All rights reserved.