Advertisement
NoHatred0

Untitled

Jul 26th, 2016
89
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.56 KB | None | 0 0
  1. <?php
  2.  
  3. function getUserList()
  4. {
  5. return $user = [
  6. [
  7. 'id' => 66,
  8. 'username' => 'gigi',
  9. 'password' => 'coco',
  10. ],
  11. [
  12. 'id' => 67,
  13. 'username' => 'coco',
  14. 'password' => 'gigi',
  15. ],
  16. ];
  17. }
  18.  
  19. function getUserByUserPass($username, $pass)
  20. {
  21. $userList = getUserList();
  22. foreach($userList as $user)
  23. {
  24. if($username == $user['username'] && $pass == $user['password'])
  25. {
  26. return $user;
  27. }
  28. }
  29. return false;
  30. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement