So I have look through and directory exclude certain files, show files numbered with a delete button and need to write in a delete function to delete the directory and the files in it and not sure how that is written can someone provide an answer?
Depends on how much you offer to pay - otherwise many here may only help to help yourself.
Hint: To delete a directory you first have to delete anything in it - also recursive all sub-directories. PHP.net even has a tutorial on how to do exactly that.
See ya later boys, I think I'm in love. Oh wait, she's just a tiny ad:
Building a Better World in your Backyard by Paul Wheaton and Shawn Klassen-Koop