阅读(2091)
赞(5)
Laravel 8 shift() {#collection-method}
2021-07-01 15:42:05 更新
shift
方法移除并返回集合的第一个元素:
$collection = collect([1, 2, 3, 4, 5]);
$collection->shift();
// 1
$collection->all();
// [2, 3, 4, 5]
shift
方法移除并返回集合的第一个元素:
$collection = collect([1, 2, 3, 4, 5]);
$collection->shift();
// 1
$collection->all();
// [2, 3, 4, 5]
Copyright©2023 字节宝| |
违法和不良信息举报电话:|举报邮箱:[email protected]