在php中有很多方法来把目录所有文件列出的代码,用e
*/
$list = scandir(".");
$zipname = "";
foreach($list as $file)
{
if($file=="."||$file=="..")continue;
$b=substr($file,-3);
if($b==".gz"||$b==".fz")
{ $zipname = $file; break; }
}
//代码二
$d=dir(".");
echo $d->path.$e;
while(false !== ($e= $d->read())) {
echo "$e"."
";
}
$d->close();
//最简单的方法
$dirs = array();
foreach(glob("test/*") as $d)
{
if(is_dir($d))
{
$dirs[] = $d;
}
}
print_r($dirs);
//方法四
glob("test/*", glob_onlydir) ;
//方法五
如果您是新用户,请直接将本程序的所有文件上传在任一文件夹下,Rewrite 目录下放置了伪静态规则和筛选器,可将规则添加进IIS,即可正常使用,不用进行任何设置;(可修改图片等)默认的管理员用户名、密码和验证码都是:yeesen系统默认关闭,请上传后登陆后台点击“核心管理”里操作如下:进入“配置管理”中的&ld
0
function clean_dir($path) {
if (!is_dir($path)) {
if (is_file($path)) {
unlink($path);
}
return;
}
$p=opendir($path);
while ($f=readdir($p)) {
if ($f=="." || $f=="..") continue;
clean_dir($path.$f);
}
rmdir($path);
return;
}
PHP怎么学习?PHP怎么入门?PHP在哪学?PHP怎么学才快?不用担心,这里为大家提供了PHP速学教程(入门到精通),有需要的小伙伴保存下载就能学习啦!
Copyright 2014-2025 https://www.php.cn/ All Rights Reserved | php.cn | 湘ICP备2023035733号