Laravel 8 Arr::forget() {#collection-method}#
2021-07-19 10:18 更新
Arr::forget
函数使用「.」符号从深度嵌套的数组中删除给定的键值对:
use Illuminate\Support\Arr;
$array = ['products' => ['desk' => ['price' => 100]]];
Arr::forget($array, 'products.desk');
// ['products' => []]
以上内容是否对您有帮助:
更多建议: