<u>复制代码</u> 代码如下:<br><meta http-equiv="Content-Type" content="text/html; charset=utf-8"> <br><?php <BR>//PHP遍历文件夹下所有文件 <br>$handle=opendir('C:\\'); //我要遍历C盘的文件 <br>echo "目录 handle: $handle <br>"; <br>echo "文件: <br>"; <br>while ($file =readdir($handle)) { <br>$file=iconv('GB2312','UTF-8',$file);//将XP的gbk编码转成UTF8 <br>echo "$file <br>"; //输出文件名 <br>} <br>closedir($handle); <br>?> <br>