Ross Lewis
0
Q:

php unset

<?php

$first = 100;
$second = 200;

$third = $first + $second;
echo "Sum = ".$third;
// Destroy a variable with unset function
unset($third);

//after delete the variable call it again to test
echo "Sum = ".$third;
?>
1
// Destroy a variable
<?php
unset ($var1, $var2.... )
?>
3

<?php

  $a = "Hello world!";
echo 
  "The value of variable 'a' before unset: " . $a . "<br>";

  unset($a);
echo 
  "The value of variable 'a' after unset: " . $a;
?>
 
1
unset (var1, var2.... )
0

New to Communities?

Join the community