<?php $input = array("red", "green", "blue", "yellow", "black");$part = array_splice($input, 0, 2);var_dump($part);var_dump($input);
Standard input is empty
array(2) { [0]=> string(3) "red" [1]=> string(5) "green" } array(3) { [0]=> string(4) "blue" [1]=> string(6) "yellow" [2]=> string(5) "black" }
The brand new service which powers Ideone!
Widget for compiling and running the source code in a web browser!