Created
November 21, 2014 02:39
-
-
Save egoist/d36417dc1339aec18d8b to your computer and use it in GitHub Desktop.
删除目录下所有文件
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<? | |
$files = glob('path/to/temp/*'); // get all file names | |
foreach($files as $file){ // iterate files | |
if(is_file($file)) | |
unlink($file); // delete file | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment