I'm new to learning php and in one of my first programs I wanted to make a basic php website with login capabilities with and array of the user and passwd.
my idea is to store the username as a list parameter and have the passwd as the contents, like this:
arr = array(username => passwd, user => passwd);
now my problem is that I don't know how I can read from the file (data.txt
) so I can add it into the array.
data.txt sample:
username passwd
anotherUSer passwd
I've opened the file with fopen
and stored it in $data
.