configu.php
index.php
新建文件夹
D:xampphtdocs1testuseuseversion/configu.php
D:xampphtdocs1testuseuseversion/index.php
D:xampphtdocs1testuseuseversion/mmmmmmmmmmm/configu2222222222222.php
D:xampphtdocs1testuseuseversion/configu.php
D:xampphtdocs1testuseuseversion/index.php
D:xampphtdocs1testuseuseversion/mmmmmmmmmmm/configu2222222222222.php
D:xampphtdocs1testuseuseversion/新建文件夹
代码:
<?php
function getDir($dirname) {
global $num;
$dh = opendir($dirname);
while (($file = readdir($dh)) !== false) {
if($file != '.' && $file != '..') {
if(is_dir($dirname . $file . '/'))
getDir($dirname . $file . '/');
else {echo $file.'<br/>';}
}}}
getDir("./useversion");
echo "<hr/>";
?>
<?php
function myscandir($pathname){
foreach( glob($pathname) as $filename ){
if(is_dir($filename)){
myscandir($filename.'/*');
}else{
echo '<br>'. $filename;
}
}
}
myscandir('D:xampphtdocs1testuseuseversion');
echo "<hr/>";
?>
<?php
function myscandir2($path){
$mydir=dir($path);
while($file=$mydir->read()){
$p=$path.'/'.$file;
if((is_dir($p)) AND ($file!=".") AND ($file!="..")){
myscandir2($p);
}
if(($file!=".") AND ($file!="..")){
echo '<br>'. $p;
}
}
}
myscandir2('D:xampphtdocs1testuseuseversion');
echo "<hr/>";
?>