php $list = array("Apple", "Banana", "Carrot");
unset($list[count($list)-1]);
// Be aware of that
// $list[] = "Orange";
// will be $list[3] and not $list[2]
<?php
$list = array("Apple", "Banana", "Carrot");
unset($list[count($list)-1]);
// Be aware of that
// $list[] = "Orange";
// will be $list[3] and not $list[2]
?>