<?php header("content-type:text/html;charset=utf8"); set_time_limit(0); $dir = "d:\\"; function show ($dir){ $handle = @opendir($dir); echo "<ul>"; while($file = @readdir($handle)){ if($file == "."||$file == "..") continue; if(is_dir("$dir/$file")){ show("$dir/$file"); }else{ if(pathinfo("$dir/$file",PATHINFO_EXTENSION) == "pdf"){ // copy("$dir/$file","./pdf/$file"); echo "<li>".iconv(‘gbk‘,‘utf-8‘,$file)."</li>"; } } } echo "</ul>"; } show($dir);
时间: 2024-10-11 13:31:07