這裏是我的代碼想創建隨機數字的文件夾,把文件中的這
$file = 'post.php';
$root = '/' . $dir_auth1 . '/'. $file;
$folder = mkdir(rand(10,10000));
$folder5 = $folder . '/' . $file;
echo $folder5;
if($folder) {
if (!copy($root, $folder5)) {
echo "failed to copy $file...\n";
} else {
echo "<p style='font-size:35px;font-family:verdana;text-align:center;'>status was successfuly created.</p>";
}
}
基本上我所要做的是在一個表單提交創建隨機數字的目錄,將$ file變量放在隨機目錄中
代碼中的任何錯誤? – Dave
[使用php創建隨機文件夾]可能的重複(http://stackoverflow.com/questions/14290391/create-random-folders-using-php) –
@Dhaval Dave 它編譯正確,但其功能無法正常工作。 – aidangig