I just started learning, can someone please give me an answer?
大大大云
大大大云 2019-02-28 22:53:11
0
0
865

To implement folder traversal output, it is required to use red for folders and blue for files, and to have hierarchical indentation with four spaces,

function myscandir($dir){

//Judge whether the path is valid

//is_dir($dir) or die('Currently is not a directory');

echo $dir,'< /br>';

if (is_dir($dir)) {

# code...

echo ' '.' '.' ';

$files = scandir($dir);

foreach ($files as $file) {


## if($file ! =='.' && $file !== '..'){

echo ' '.' '.' ';

myscandir($file);

}

}

}

How to write this code?


大大大云
大大大云

reply all(0)
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template