I have a PHP array as follows:
$messages = [312, 401, 1599, 3, ...];
I want to delete the element containing the value $del_val
$del_val
Or simply, manual way:
foreach ($array as $key => $value){ if ($value == $target_value) { unset($array[$key]); } }
This is the safest of them because you have full control on your array