Home > Backend Development > PHP Tutorial > A directory traversal function_PHP tutorial

A directory traversal function_PHP tutorial

WBOY
Release: 2016-07-21 16:09:46
Original
1012 people have browsed it


A directory traversal function
function dirtree($path="./test") {
echo "

";
$d = dir($path);
while (false !== ($v = $d->read())) {
if($v == "."
$v == "..")
continue;
$file = $d->path."/".$v;
echo "
$v";
if(is_dir($file))
dirtree($file );
}
$d->close();
echo "
";
}

dirtree();
?>

www.bkjia.comtruehttp: //www.bkjia.com/PHPjc/314378.htmlTechArticleA directory traversal function?php function dirtree($path="./test") { echo "dl"; $d = dir($path); while(false !== ($v = $d-read())) { if($v == "." $v == "..") continue; $file = $d-path."...
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template