- array_splice: documentation ( source)
- print_r: documentation ( source)
<?php
$input = array("red", "green", "blue", "yellow", "1", "2", "3","4");
array_splice($input, -1, 1);
#array_splice($input, -1, 1, array("black", "maroon"));
#array_splice($input, 1, -3);
print_r($input);