开发者

return php array from certain index and on

What is a function to return an array containing only elements from a certain index on?

so I have an array $array = ('0', '1', '2', '3', '4')

I want to return an array that looks like ('2', '3', '4')

开发者_StackOverflow社区How do I do that using index 2?

Thanks in advance


You can use array_slice:

$array = array('0', '1', '2', '3', '4');
print_r(array_slice($array,2));


Perhaps you would like to array_slice it?

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜