Get files from folder and delete them in php:
function readDirectory_files(){
// get all file names
$files = glob('path/to/temp/*');
#OR
#$files = glob($FILE_PATH.'*');
foreach($files as $file){ // iterate files
if(is_file($file)){
echo '<pre>';
print_r($file);
echo '</pre>';
}
}
}
No comments:
Post a Comment