手机
当前位置:查字典教程网 >编程开发 >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函数的使用以及参数详解】相关文章:

Mysql的常用命令

php自定义hash函数实例

BBS(php & mysql)完整版(三)

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

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

php动态函数调用方法

PHP数组和explode函数示例总结

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

php使用for语句输出三角形的方法

PHP5.2下preg_replace函数的问题

精品推荐
分类导航