4 [1] => 5 )*//*$arr=array(1,2,3,4,5);$newArr=array_slice($arr,3,1);print_r($newArr);//输出:Array ( [0] => 4 )*//*$arr=array(1,2,3,4,5);$newArr=array_slice($arr,2,1,true);print_r($newArr);//输出:Array ( [2] => 3 )*///array_splice() 删除指定范围的数组元素,如果指定第四个参数,则在删除元素位置放入第四个元素的值。/*$arr=array(1,2,3,4,5);$newArr=array_splice($arr,2,1);print_r($newArr);//输出:Array ( [0] => 3 )echo "==================";print_r($arr);//输出:Array ( [0] => 1 [1] => 2 [2] => 4 [3] => 5 )*//*$arr=array(1,2,3,4,5);$val=array('bbs','php');$newArr=array_splice($arr,2,1,$val);print_r($newArr);//输出:Array ( [0] => 3 )echo "==================";print_r($arr);//输出:Array ( [0] => 1 [1] => 2 [2] => bbs [3] => php [4] => 4 [5] => 5 )*///array_sum()对数组中的值进行求和运算//array_product()对数组中的值进行乘积运算$arr=array(1,2,3,4,5);echo array_sum($arr);//输出:15echo array_product($arr);//输出:120