'; foreach($list as $file){ $target = "$dir/$file"; ..."> PHP file traversal-PHP Tutorial-php.cn

PHP file traversal

巴扎黑
Release: 2016-11-12 11:21:37
Original
1070 people have browsed it

$dir = "D:\workspace"; function list_file($dir = '.'){ $list = scandir($dir); echo '
    '; foreach($list as $file){ $target = "$dir/$file"; if ( is_dir($target) && $file != '.' && $file != '..' ){ echo "
  1. $file
  2. "; list_file($target); } else if ( $file != '.' && $file != '..'){ echo "
  3. $file
  4. "; } } echo '
'; } list_file($dir);
Copy after login

Related labels:
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
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!