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 7927065
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 3, 20262026-06-03T19:07:16+00:00 2026-06-03T19:07:16+00:00

This is the first array: $possible_combinations = array( 1 => array(1), 2 => array(2),

  • 0

This is the first array:

$possible_combinations = array(
    1 => array(1),
    2 => array(2),
    3 => array(3),
    4 => array(4),

    5 => array(1, 2),
    6 => array(1, 3),
    7 => array(1, 4),       

    8 => array(2, 3),
    9 => array(2, 4),       

    10 => array(3, 4),

    11 => array(2, 3, 4),
    12 => array(1, 3, 4),
    13 => array(1, 2, 4),
    14 => array(1, 2, 3),

    15 => array(1, 2, 3, 4)
);

This is the second array:

$seeking = array(2, 3, 4);

As you can see $possible_combinations[11] matches $seeking.

The value of $seeking in this case is 2, 3, 4 but it may be different at other times. How can I run a check against the
$possible_combinations array to see if the $seeking array matches any of the values of that associative array.
It should return the key of the match if there is one.

  • 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-03T19:07:19+00:00Added an answer on June 3, 2026 at 7:07 pm

    You can use PHP’s built-in array_search() function for this.

    $search = array_search($seeking,$possible_combinations);
    
    if ($search !== FALSE) {
        echo 'Found at ' . $search;
    } else {
        echo 'Not Found';
    }
    

    http://www.php.net/manual/en/function.array-search.php

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

i have two arrays like this first array Array ( [0228] => Array (
Consider a string array shaped like this: string[] someName = new string[] { First,
I have this array and I need to sort it, first by key_1 and
I'm trying to process this array, first testing for the presence of a check,
I have two arrays the first one has this structure Parameter Keys array array
I need to decode and specifically target the first url only in this array:
This is my first question here :) I have an array with a number
data is coming this form Array ( [User] => Array ( [first_name] => sxsaxs
This is the first time I have manipulated hashes and arrays in this way
This first bit works: $my_id = 617; $post_id_7 = get_post($my_id); $title = $post_id_7->post_excerpt; echo

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.