php 读取目录文件
<?php
/**
* Created by PhpStorm.
* User: Administrator
* Date: 2016/4/6
* Time: 17:01
*/
$dir = dirname(__FILE__);
$handle = opendir($dir.'.');
$array_file = array();
while(false!==($file = readdir($handle))){
if($file!="."&& $file !=".."){
$array_file[]=$file;
}
}
closedir($handle);
print_r($array_file);die;