Laravel 8 Arr::only() {#collection-method}
2021-07-19 10:18 更新
Arr::only 函数只返回给定数组中指定的键值对:
use Illuminate\Support\Arr;
$array = ['name' => 'Desk', 'price' => 100, 'orders' => 10];
$slice = Arr::only($array, ['name', 'price']);
// ['name' => 'Desk', 'price' => 100] 以上内容是否对您有帮助:

免费 AI IDE


更多建议: