Answers for "remove array from php array"

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 array from php array"

Browse Popular Code Answers by Language