Answers for "php remove object from array"

PHP
0

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;
}
Posted by: Guest on November-02-2020

Code answers related to "php remove object from array"

Browse Popular Code Answers by Language