<div class="codetitle"> <span><a style="CURSOR: pointer" data="91765" class="copybut" id="copybut91765" onclick="doCopy('code91765')"><u>复aze代码</u></a></span> 代码如下:</div> <div class="codebody" id="code91765"> <br><div id="jQ-menu"> <br><?php <BR>$path = "./"; <BR>function createDir($path = '.') <BR>{ <BR>if ($handle = opendir($path)) <BR>{ <BR>echo "<ul>"; <br>while (false !== ($file = readdir($handle))) <br>{ <br>if (is_dir($path.$file) && $file != '.' && $file != '..') <br>printSubDir($file, $path, $queue); <br>else if ($file != '.' && $file !='..') <br>$queue[] = $file; <br>} <br>printQueue($queue, $path); <br>echo "</ul>"; <br>} <br>} <br>function printQueue($queue, $path) <br>{ <br>foreach($queue를 $file로) <br>{ <br>printFile($file, $path) ; <br>} <br>} <br>function printFile($file, $path) <br>{ <br>echo "<li><a href="".$path.$file.""> ;$파일"; <br>} <br>function printSubDir($dir, $path) <br>{ <br>echo "<li><span class="toggle">$dir</span>"; <br>createDir($path.$dir."/"); <br>echo "</li>"; <br>} <br>createDir($path); <br>?> <br></div> <br> </div>