<div class="codetitle"> <span><a style="CURSOR: pointer" data="67177" class="copybut" id="copybut67177" onclick="doCopy('code67177')"><u>复制代码</u></a></span> 代码如下:</div> <div class="codebody" id="code67177"> <br>function list_files($dir) <br>{ <br>if(is_dir($dir)) <br>{ <br>if($handle = opendir($dir)) <br>{ <br>while(($file = readdir($handle)) !== false) <br>{ <br>if($file != "." && $file != ".." && $file != "Thumbs.db") <br>{ <br>echo '<a target="_blank" href="'.%24dir.%24file.'">'.$file.'</a><br>'."\n"; <br>} <br>} <br>closedir($handle); <br>} <br>} <br>} <br> </div> <br>这里是摘自脚本之家之前发布的文章。更多的技巧可以参考。<br><a href="http://www.jb51.net/article/23144.htm" target="_blank">收集的二十一个实用便利的PHP函数代码</a>