Laravel 8 Arr::forget() {#collection-method}#
Arr::forget
函数使用「.」符号从深度嵌套的数组中删除给定的键值对:
use Illuminate\Support\Arr;
$array = ['products' => ['desk' => ['price' => 100]]];
Arr::forget($array, 'products.desk');
// ['products' => []]
Arr::forget
函数使用「.」符号从深度嵌套的数组中删除给定的键值对:
use Illuminate\Support\Arr;
$array = ['products' => ['desk' => ['price' => 100]]];
Arr::forget($array, 'products.desk');
// ['products' => []]