gf1987 Posted September 29, 2010 Share Posted September 29, 2010 Hello everyone. I am having trouble trying to write some script that will unlink all files in a directory. Can anyone help me? I am not sure of the best way to do this? Thankyou. Quote Link to comment Share on other sites More sharing options...
AbraCadaver Posted September 29, 2010 Share Posted September 29, 2010 Something like: foreach(glob('/dir/*') as $file) { if(is_file($file)) { unlink($file); }} Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.