Well, you can do it different ways. One way could be:
[username][separator][password]
so if you choose your separator to be a colon, your password file will look like:
user1:password1
user2:password2
user3:password3
So, once you have the password file, you can use file() to read each line into an array. Then use explode() to separate the usernames and passwords and put them into an associative array (hash). Then use that hash to check the password.
If you don't understand some of the functions that I've used here, or some of the terms (like associative array), I'd recommend you get a PHP book and start from there.
Diego