📜  php 如何在保存文件之前重命名文件 - PHP 代码示例

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

代码示例1
$temp = explode(".", $_FILES["file"]["name"]);
$newfilename = round(microtime(true)) . '.' . end($temp);
move_uploaded_file($_FILES["file"]["tmp_name"], "../img/imageDirectory/" . $newfilename);