how to delete object php code example
Example 1: delete property from object php
unset($a->new_property);
Example 2: php remove object from array
unset($array[$key]);
// You can do using function when no key
function unsetValue(array $array, $value, $strict = TRUE)
{
if(($key = array_search($value, $array, $strict)) !== FALSE) {
unset($array[$key]);
}
return $array;
}