PHP头条
热点:

php-offset(距离末端这么远的地方开始)


php

array array_slice ( array $array , int $offset [, int $length [, bool $preserve_keys ]] )
array_slice() 返回根据 offset 和 length 参数所指定的 array 数组中的一段序列。

如果 offset 非负,则序列将从 array 中的此偏移量开始。如果 offset 为负,则序列将从 array 中距离末端这么远的地方开始(这是什么意思)。
$input = array("a", "b", "c", "d", "e");
$output = array_slice($input, -1); // returns "e"

如果是距离末端‘e’开始左移一位的话,那不应是‘d’么??

www.phpzy.comtrue/php/938.htmlTechArticlephp-offset(距离末端这么远的地方开始) php array array_slice ( array $array , int $offset [, int $length [, bool $preserve_keys ]] ) array_slice() 返回根据 offset 和 length 参数所指定的 array 数组中的一段序列。...

相关文章

相关频道:

PHP之友评论

今天推荐