Write a relatively bad directory file list program, support multiple systems, can be sorted by time, can enter the multi-level directory, other functions please add yourself!
Source: Internet
Author: User
Compare | program | sort PLEASE criticize!!!
<?//list.php
Power by Devchina.com 2oa.net
$Path = ($dir) urldecode ($dir): "D:";/best use Session to set PATH security
$handle =opendir ($Path);
while ($file = Readdir ($handle)) {
$newpath = $Path. " /". $file;
if ($file = = "..." or $file = = ".") {
You can put. Or. Add a connection as a back to the previous layer ";
Continue
}
if (Is_dir ($newpath)) {
$p [Intval (Filemtime ($newpath))]= $file;
}else
{
$f [Intval (Filemtime ($newpath))]= $file;
}
}
echo "Collation: Time <a href=list.php?order=up&dir= $dir > L </a> (oldest file in front) <a Href=list.php?order=down &dir= $dir > Drop </a> (latest file in front) ";
$CD = ($order = = "Up") sizeof (@ksort ($p)): sizeof (@krsort ($p));
$CF = ($order = = "Up") sizeof (@ksort ($f)): sizeof (@krsort ($f));
if ($cd >0) {
The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion;
products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the
content of the page makes you feel confusing, please write us an email, we will handle the problem
within 5 days after receiving your email.
If you find any instances of plagiarism from the community, please send an email to:
info-contact@alibabacloud.com
and provide relevant evidence. A staff member will contact you within 5 working days.
A Free Trial That Lets You Build Big!
Start building with 50+ products and up to 12 months usage for Elastic Compute Service