array_slice() and array_splice() in php

array_slice()  returns selected parts of array,while array_splice() removes and replaces specifield elements of an array
example of array_slice():
<?php
$a=array(0=>"one", 2=>"two",3=>"three", 4=>"four");
print_r(array_slice($a,1,2));
it returns: array([0]=>"two",[1]=>"three");

?>
example of array_splice():
<?php
$a=array(0=>"one", 2=>"two",3=>"three", 4=>"four");
$b=array(0=>"ones", 2=>"twos");
print_r(array_splice($a,0,2,$b));
it returns: array([0]=>"ones", [2]=>"twos",[3]=>"three",[ 4]=>"four");

?>