📌  相关文章
📜  调用字符串上的成员函数 move() - PHP 代码示例

📅  最后修改于: 2022-03-11 14:54:12.133000             🧑  作者: Mango

代码示例1
if ($request->hasFile('file')) {
    $destinationPath = 'path/th/save/file/';
    $files = $request->file('file'); // will get all files

    foreach ($files as $file) {//this statement will loop through all files.
        $file_name = $file->getClientOriginalName(); //Get file original name
        $file->move($destinationPath , $file_name); // move files to destination folder
    }
}