Answers for "php remove element from array and reindex"

PHP
12

php remove item array

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

unset($items[0]);

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

php remove array element reset keys

unset($foo[0]); // remove item at index 0
$foo2 = array_values($foo); // 'reindex' array
Posted by: Guest on September-23-2020
0

remove array values php

array_splice(array, start, length, array)
Posted by: Guest on November-03-2020

Code answers related to "php remove element from array and reindex"

Browse Popular Code Answers by Language