Returning first x items from array

后端 未结 5 645
小蘑菇
小蘑菇 2020-12-01 03:14

I want to return first 5 items from array. How can I do this?

5条回答
  •  不思量自难忘°
    2020-12-01 03:42

    You can use array_slice function, but do you will use another values? or only the first 5? because if you will use only the first 5 you can use the LIMIT on SQL.

提交回复
热议问题