I have a function that deletes the files chosen by the user, but if its a directory and has files in it it doesn't work. Is there a way to loop through and unlink every file before removing the directory? All help appreciated.
If its a directory use the php function readdir and thatll return a list of files in that directory, use a while loop to go round each one deleting the files, then carry on with deleting any other files you need