<table cellspacing="0" cellpadding="0"><tr><td class="t_f" id="postmessage_31278"> <div class="blockcode"> <div id="code_nKM"><ol> <li> <li><?php<li>/*<li>简单的目录递归函数<li>*/<li>function tree($directory)<li>{<li>$mydir=dir($directory);<li>echo "<ul>";</li> <li>while($file=$mydir->read()){</li> <li>if((is_dir("$directory/$file")) AND ($file!=".") AND ($file!="..")){</li> <li>echo "<li><font color='#ff00cc'><b>$file</b></font></li>";</li> <li>tree("$directory/$file");</li> <li>}else{</li> <li>echo "<li>$file</li>";</li> <li>}</li> <li>}</li> <li>echo "</ul>";</li> <li>$mydir->close();</li> <li>}</li> <li>//start the program</li> <li>echo "<h2>目录为粉红色</h2>";</li> <li>tree(".");</li> <li>?></li> </ol></div> <em onclick="copycode($('code_nKM'));">复制代码</em> </div> </td></tr></table> <div id="comment_31278" class="cm"> </div> <div id="post_rate_div_31278"></div> <br><br>