I have come here to hopefully seek an answer to a question I have about PHP arrays. First off, I have been an on and off PHP/MySQL developer for 5 years now, but have always worked on my own projects. One thing I never got into was arrays, at first they looked a bit scary and it puts me off wanting to learn it (sounds wussy, I know) I also have books with chapters on arrays, and they do make a bit more sense to me now, but I cannot find a use for them.
Currently I am working on a small login script, I don't want to go too overboard because this isn't a big project, so I am doing it the easy way, which is this:
<?php else: // if login is pressed $username = $_POST['username']; $password = $_POST['password']; if($username == "chris" && $password == "meh"): echo("logged in"); else: echo("not logged in"); endif; ?>
I am guessing that you could do this using arrays right, but I wouldn't know where to begin. I am hoping that I can get some advice on how to use arrays to store usernames and passwords and use them when checking for a login. I am not even sure if this can be done, but I bet it can.
I am asking for this help to expand my knowledge on my favourite language to use. I have checked countless tutorial websites but I never see what I am seeking, so I can't wait to here you're answers (if I get any)
Thanks for your time.