Laravel 8 zip() {#collection-method}
2021-07-19 10:01 更新
zip
方法在与集合的值对应的索引处合并给定数组的值:
$collection = collect(['Chair', 'Desk']);
$zipped = $collection->zip([100, 200]);
$zipped->all();
// [['Chair', 100], ['Desk', 200]]
>
以上内容是否对您有帮助:
更多建议: