So I'm back to my .txt file which is really a username|password file.
This file contains all of the username's , passwords and emails of my users.
The current program creates a directory when the user signs up, but due to poor code design (not my own), when an invalid email address or invalid username was entered, the directory was still created!
I've cleaned out all of the bad usernames that have either invalid emails or usernames from the txt file. So now I have to get rid of the some 200+ directories that had invalid usernames.
The plan
Now I need to read my .txt file which is formated like this
username|password - email
which contains 2000 or so entries, and then whichever directories exist that aren't in the txt file need removed.
This sounds easy, but it's not so if you get to thinking about it. For each directory, I must search the user.txt file for an entry. If it's not in the txt file then delete.
First off...does anyone know how to delete a directory from PHP and then secondly how to go about coding this problem?
Thanks a bunch!!