Answers for "remove get array out of array php"

PHP
16

php remove item array

$items = ['banana', 'apple'];

unset($items[0]);

var_dump($items); // ['apple']
Posted by: Guest on March-20-2020
0

unset php return array

function array_remove(array &$arr, $key) {
    if (array_key_exists($key, $arr)) {
        $val = $arr[$key];
        unset($arr[$key]);

        return $val;
    }

    return null;
}
Posted by: Guest on October-08-2021

Code answers related to "remove get array out of array php"

Browse Popular Code Answers by Language