手机
当前位置:查字典教程网 >编程开发 >php教程 >php array_slice函数的使用以及参数详解
php array_slice函数的使用以及参数详解
摘要:复制代码代码如下:重点说下length为负.它表示取数组一直到距离数组末端length这么远的距离

复制代码 代码如下:

<?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"

?>

重点说下length 为负.它表示取数组一直到距离数组末端length这么远的距离

【php array_slice函数的使用以及参数详解】相关文章:

PHP中GET变量的使用

留言板翻页的实现详解

php中set_error_handler的用法总结

phpBB BBcode处理的漏洞

PHP5在Apache下的两种模式的安装

php通过exif_read_data函数获取图片的exif信息

php实现的mongodb操作类

PHP date函数常用时间处理方法

php自定义hash函数实例

php eval函数一句话木马代码

精品推荐
分类导航