Array_slice
(PHP4)
Array_slice---&http://www.aliyun.com/zixun/aggregation/37954.html ">nbsp; Extract part of an array
Syntax: array array_slice (array array, int offset, int [length]);
Description:
This function returns a part of the element from the array, and if offset is a positive number, the retrieved part starts at the offset in the array, and the offset is negative, starting at the end of the array. If length is given and is positive, the length of the element will be retrieved, and if length is negative, the length of the element at the end of the array will be stopped, and if this argument is omitted, the returned portion will be from offset to the end of the array.
Example:
<?php
$input = Array ("A", "B", "C", "D", "E");
$output = Array_slice ($input, 2); Returns "C", "D", and "E"
$output = Array_slice ($input, 2,-1); Returns "C", "D"
$output = Array_slice ($input,-2, 1); Returns "D"
$output = Array_slice ($input, 0, 3); Returns "A", "B", and "C"
?>
Reference: Array_splice ()