added tips to lamer.bash help
[mirrors/Programs.git] / php / skripty / find_recursive.php
CommitLineData
8de51304
H
1<pre>\r
2<?php\r
3\r
4//\r
5function dir_scan($directory, $slash="/") {\r
6\r
7 if($GLOBALS["num"] == 0) echo("<title>$directory</title>\n<h1><a href=\"file:///$directory\">$directory</a></h1>\n");\r
8 $files=opendir ($directory); \r
9 while (false!==($file = readdir($files))) \r
10 { \r
11 if ($file != "." && $file != "..") \r
12 { \r
13 if(is_dir($directory.$file)) echo("[DIR] ");\r
14 //echo "$directory$file\n"; \r
15 echo "<a href=\"file:///$directory$file\">$directory$file</a>\n"; \r
16 $GLOBALS["num"] = ($GLOBALS["num"] + 1);\r
17 if(is_dir($directory.$file)) dir_scan($directory.$file.$slash,$slash);\r
18 } \r
19 }\r
20 closedir($files); \r
21\r
22}\r
23\r
24///CODE////////////////////////\r
25$num = "0";\r
26dir_scan("x:\\", "\\");\r
27echo("\nTotal: $num\n");\r
28?>\r
29</pre>\r
This page took 0.550701 seconds and 4 git commands to generate.