我正在尝试从多文件输入数组中获取文件的文件扩展名。
我尝试使用 File::extension()
但它需要一个字符串,而我有一个数组。
我不需要这个值进行验证,因此我无法使用 Laravel 验证。谢谢
最佳答案
I am trying to get the file extension of the files from the multiple file input array.
然后循环遍历 $_FILES
数组。
foreach ($_FILES as $key => $file) {
$extensions[$key] = \File::extension($file['name']);
}
上面假设没有花哨/固执的 $_FILES 结构突变;p
关于php - 数组值的 Laravel 文件扩展名,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/46253728/