我是PHP新手。PHP中是否有任何函数可以让您获得数组中的2-6个元素?例如在Python中。
>>>array = [0,1,2,3,4,5,6,7,8,9] >>>print(array[2:6]) [2,3,4,5]
发布于 2015-09-23 14:36:22
这叫切片;P
因此,您应该查看php的array_slice
array_slice
https://stackoverflow.com/questions/32742467
相似问题