【发布时间】:2017-03-27 07:49:20
【问题描述】:
我是刚开始我的编程工作的新手,我已经需要帮助了! :) 好吧,我希望我的脚本首先显示文件夹,然后显示文件,所以像文件夹这样的文件优先级更高,然后是最后。这是脚本
<?php
if ($handle = opendir('.')) {
while (false !== ($file = readdir($handle)))
{
if ($file != "." && $file != ".." && !preg_match('/\.php$/i', $file) && !preg_match('/robots.txt$/i', $file))
{
$thelist .= '<LI><a href="'.$file.'">'.$file.'</a>';
}
}
closedir($handle);
}
?>
【问题讨论】: