Answers for "unset() in php"

PHP
3

destroy php variable

<?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;
?>
Posted by: Guest on August-23-2020
0

unset php

//remove variable
unset($var1,$var2,$var3;
//remove array
unset($array['$key']);
Posted by: Guest on October-08-2021
0

php unset by value

if (($key = array_search($del_val, $messages)) !== false) {
    unset($messages[$key]);
}
Posted by: Guest on December-04-2021

Browse Popular Code Answers by Language