Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8703153
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 13, 20262026-06-13T02:48:44+00:00 2026-06-13T02:48:44+00:00

how can i arrange an array data in phpp so that it can match

  • 0

how can i arrange an array data in phpp so that it can match 2 or more values?

EX:
users.php

$USERS["username1"] = "password1";

direct.php

include("users.php");

$user = $_POST['user'];
$pass = $_POST['pass'];

if ($USERS[$user]==$pass) { 

echo "welcome";
}

so in the $USERS array the value will satify the if statement if the user inputs

“username1” and “passsword1”

what i want to do is allow the “username1” to be paired with other values

 $USERS["username1"] = "password1" , "password3" , "password109";

even if the user inputs any of these 3

"password1" , "password3" , "password109"

it will satisfy the if statement is there anyway to do this?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-13T02:48:45+00:00Added an answer on June 13, 2026 at 2:48 am

    I guess what you need is in_array()

    $users['username1'] = array('password1','password3','azeadnfksfn');
    
    if (in_array($password,$users[$user])) {
        echo 'Welcome';
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a few data values that I need to store on my rails
How can I re-arrange a array of objects like this: [495] => stdClass Object
Before suggesting bin packing algorithms, they assume you can re-order the elements and arrange
Can I order my users in the database, so I don't have to say
I have an inline assembler loop that cumulatively adds elements from an int32 data
If I have a 2D array that is arranged as follows : String X[][]
I have an array of values, and an array which determines the order. How
Possible Duplicate: Dynamically creating/inserting into an associative array in PHP I have the following
Well I am trying to sort some data in PHP. Here is an example
First of all, I got this huge xml file that represents data collected by

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.