1$items = ['banana', 'apple'];
2
3unset($items[0]);
4
5var_dump($items); // ['apple']
1<?php
2$input = array("red", "green", "blue", "yellow");
3array_splice($input, 2);
4var_dump($input);
5
6$input = array("red", "green", "blue", "yellow");
7array_splice($input, 1, -1);
8var_dump($input);
9
10$input = array("red", "green", "blue", "yellow");
11array_splice($input, 1, count($input), "orange");
12var_dump($input);
13
14$input = array("red", "green", "blue", "yellow");
15array_splice($input, -1, 1, array("black", "maroon"));
16var_dump($input);
17?>