function get_dir_all_files($path) { $result=array(); $temp=array(); if(filetype($path)=='dir') { $dir=scandir($path); foreach($dir as $value) { if($value!='.'&&$value!='..') { if(filetype("$path/$value")!='dir') { $result[]="$path/$value"; }else { $temp=array_merge($temp,get_dir_all_files("$path/$value")); } } } } return array_merge($result,$temp);; }