Laravel 8 Arr::set() {#collection-method}
2021-07-19 10:19 更新
Arr::set
函数使用「.」符号在多维数组中设置指定键的值:
use Illuminate\Support\Arr;
$array = ['products' => ['desk' => ['price' => 100]]];
Arr::set($array, 'products.desk.price', 200);
// ['products' => ['desk' => ['price' => 200]]]
以上内容是否对您有帮助:
更多建议: