View Problem

Remove an element from a list by index

Given the list [Apple, Banana, Carrot], remove the first element to produce the list [Banana, Carrot]
ExpandDiskEdit
php
$list = array("Apple", "Banana", "Carrot");
unset($list[0]);

// Be aware of that $list[0] isn't set. "Banana" is still $list[1]
ExpandDiskEdit
php
$list = array("Apple", "Banana", "Carrot");
array_shift($list);

// Be aware of that $list[0] is set to "Banana"

Submit a new solution for php
There are 28 other solutions in additional languages (clojure, cpp, csharp, erlang ...)