Unset or Destroys Variable in PhP

 

Unset or Destroys Variable in PhP

unset() destroys the specified variables.

<?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);
?>

The behavior of unset() inside of a function can vary depending on what type of variable you are attempting to destroy.
In can be used to remove a single variable, multiple variables, or an element from an array. It is used as unset ($remove).


Post a Comment



We use third-party advertising companies to serve ads when you visit our website. These companies may use information (not including your name, address, email address, or telephone number) about your visits to this and other websites in order to provide advertisements about goods and services of interest to you.