手机
当前位置:查字典教程网 >编程开发 >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中smarty变量修饰用法实例分析

PHP5.2下preg_replace函数的问题

php解析xml方法实例详解

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

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

PHP数组和explode函数示例总结

php eval函数一句话木马代码

win7 php环境搭建教程:win7下php环境搭建步骤详解

phplot生成图片类用法详解

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

精品推荐
分类导航