Is there a php function that can delete all or certain files in a given directory without deleting the directory?
unlink(path/to/$file);
you will get a permission error if you don't have permissoin to that directory.