我想重命名文件並將其上傳到服務器以及數據庫中。我有一個代碼:PHP如何重命名上傳的文件?
$file = $_FILES['file'];
list(,$type) = explode('/', $file['type']);
move_uploaded_file($file['tmp_name'], 'images/'.time().'.'.$type);
$a = time();
$b = ($a.'.'.$type);
它正在工作,但我不確定它是如何工作的。我如何將此'images/'.time().'.'.$type
更改爲我想要的名稱,例如:'images/'myname.time().'.'.$type)
所有這些點和引號都正在殺死我!
_ 「!所有這些點和報價都殺了我」 _見[這裏](http://nl.php.net/manual/en/language.types.string.php)和[這裏](HTTP: //php.net/manual/en/language.operators.string.php)。 – CodeCaster