阅读(566) (9)

Laravel 8 Arr::divide() {#collection-method}

2021-07-02 16:48:59 更新

Arr::divide 函数返回一个二维数组,一个值包含原数组的键,另一个值包含原数组的值:

use Illuminate\Support\Arr;

[$keys, $values] = Arr::divide(['name' => 'Desk']);

// $keys: ['name']

// $values: ['Desk']