refactor: 修改array_flatten函数相关

This commit is contained in:
2025-06-07 14:03:47 +08:00
parent 6c5f66ef54
commit 09943775fd
4 changed files with 15 additions and 15 deletions

View File

@@ -104,6 +104,18 @@ if (!function_exists('array_to_tree')) {
}
}
if (!function_exists('array_flatten')) {
/**
* 将多维数组转换为一维数组
* @param array $array
* @return array
*/
function array_flatten(array $array, int $depth = 1): array
{
return \think\helper\Arr::flatten($array, $depth);
}
}
if (!function_exists('thumb')) {
/**
* 获取缩略图