Answers for "remove aitem from array using php"

PHP
15

php remove item array

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

unset($items[0]);

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

php erase element from array

foreach ($items as $key =>$item){
  if(condition){
    unset($item[$key]);
  }
}
Posted by: Guest on July-08-2020

Code answers related to "remove aitem from array using php"

Browse Popular Code Answers by Language