遍历一个文件夹及子文件夹,返回所有符合指定**正则条件**的完整文件路径名
function getFilePath($path,$str='/\*\*正则条件\*\*/'){ $handle = opendir($path); while(($item=readdir($handle)) != false){ if($item!="."&&$item!=".."){ if(preg_match($str,filename($item))){ $result[] = filename($item); } } } return $result; }