array_slice函数

实例

从数组的第二个元素开始取出,并仅返回两个元素


"red","b"=>"green","c"=>"blue","d"=>"yellow","e"=>"brown");
print_r(array_slice($a,1,2));

$a=array("0"=>"red","1"=>"green","2"=>"blue","3"=>"yellow","4"=>"brown");
print_r(array_slice($a,1,2));
?>

实例

带有字符串和整数键名



http://www.w3school.com.cn/php/func_array_slice.asp

你可能感兴趣的:(学习)