列文件夹内的文件

if ($handle = opendir('c:/doc')) {

while (false !== ($file = readdir($handle))) {
echo "$file\n";
}
如何将上边所得到的文件名赋给一个数组变量,再echo出来???
---------------------------------------------------------------

不好意思,写溜了手
foreach($files as $v)
echo "$v

1<br/>

";
reset($files);

reset();的作用是让数组指针回到头,因为foreach回移动数组的内部指针

Published At
Categories with Web编程
Tagged with
comments powered by Disqus