Question : destroy php variable
Answered by : nitesh-jangid
<?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;
?>
Source : | Last Update : Sun, 30 Aug 20
Question : unset php
Answered by : cadoteu
//remove variable
unset($var1,$var2,$var3;
//remove array
unset($array['$key']);
Source : | Last Update : Fri, 15 Oct 21
Question : php unset by value
Answered by : indian-gooner
if (($key = array_search($del_val, $messages)) !== false) { unset($messages[$key]);
}
Source : https://stackoverflow.com/questions/7225070/php-array-delete-by-value-not-key | Last Update : Sat, 11 Dec 21