Laravel 8 Arr::dot() {#collection-method}
2021-07-19 10:17 更新
Arr::dot
函数将多维数组中所有的键平铺到一维数组中,新数组使用「.」符号表示层级包含关系:
use Illuminate\Support\Arr;
$array = ['products' => ['desk' => ['price' => 100]]];
$flattened = Arr::dot($array);
// ['products.desk.price' => 100]
以上内容是否对您有帮助:
更多建议: