Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- delete_files('/path/for/the/directory/');
- /*
- * php delete function that deals with directories non-recursively
- */
- function delete_files($target) {
- $files = glob( $target . '*', GLOB_MARK );
- foreach( $files as $file )
- {
- if(is_dir($file)){
- rmdir( $file );
- } elseif(is_file($file)) {
- unlink( $file );
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement