需要帮助创建BackUp目录

时间:2015-11-15 23:28:08

标签: php microtime

 $backuparray = implode("|",$songarray1);
 file_put_contents("backups/".microtime("tunes.txt"),$backuparray);

如何使用microtime,所有者ID,提交和大小来获取我的备份目录以链接txt文件?该文件需要在microtime结尾处有tunes.txt

1 个答案:

答案 0 :(得分:0)

$dir = "/var/html/uploads";
if (is_dir($dir)) {
echo("<table border='1' width='100%'>\n");
echo("<tr><th>Filename</th><th>File Size</th>
<th>File Type</th></tr>\n");
$dirEntries = scandir($dir);
foreach ($dirEntries as $entry) {
    $entryFullName = ($dir . "/" . $entry);
     echo("<tr><td>" . htmlentities($entry) . "</td><td>".
     filesize($entryFullName) . "</td><td>" .
     filetype($entryFullName) . "</td></tr>\n");
}
 echo("</table>\n");
}
else
echo("<p>The directory " . htmlentities($dir) . " does not
exist.</p>");