Mega Code Archive

 
Categories / Php / Data Type
 

Remove a portion of the array and replace it with something else

//array_splice() examples <? $input = array("red", "green", "blue", "yellow"); array_splice($input, 2);  array_splice($input, 1, -1); array_splice($input, 1, count($input), "orange"); array_splice($input, -1, 1, array("black", "maroon")); ?>