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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 28, 20262026-05-28T14:46:53+00:00 2026-05-28T14:46:53+00:00

I the following multidimensional array that I want to be able to search a

  • 0

I the following multidimensional array that I want to be able to search a particular value based on certain criteria:

$pay_rate_lookup = array(
    "text" => array( //rates for text files
        "type_of_work" => array(
            "option1" => array(
                "timeFrame" => array(
                    "within_24_hours" => 1.00,
                    "within_1_2_days" => 2.00,
                    "within_3_5_days" => 3.00,
                    "within_1_2_weeks" => 4.00
                )
            ),
            "option2" => array(
                "timeFrame" => array(
                    "within_24_hours" => 5.00,
                    "within_1_2_days" => 3.00,
                    "within_3_5_days" => 2.00,
                    "within_1_2_weeks" => 2.00
                )
            ),
            "option3" => array(
                "timeFrame" => array(
                    "within_24_hours" => 5.00,
                    "within_1_2_days" => 5.00,
                    "within_3_5_days" => 4.00,
                    "within_1_2_weeks" => 2.00
                )
            ),
            "option4" => array(
                "timeFrame" => array(
                    "within_24_hours" => 2.00,
                    "within_1_2_days" => 8.00,
                    "within_3_5_days" => 5.00,
                    "within_1_2_weeks" => 1.00
                )
            )
        )
    ),
    "non-text" => array(
        "type_of_work" => array(
            "option1" => array(
                "timeFrame" => array(
                    "within_24_hours" => 10.00,
                    "within_1_2_days" => 20.00,
                    "within_3_5_days" => 30.00,
                    "within_1_2_weeks" => 40.00
                )
            ),
            "option2" => array(
                "timeFrame" => array(
                    "within_24_hours" => 50.00,
                    "within_1_2_days" => 30.00,
                    "within_3_5_days" => 20.00,
                    "within_1_2_weeks" => 20.00
                )
            ),
            "option3" => array(
                "timeFrame" => array(
                    "within_24_hours" => 50.00,
                    "within_1_2_days" => 50.00,
                    "within_3_5_days" => 40.00,
                    "within_1_2_weeks" => 20.00
                )
            ),
            "option4" => array(
                "timeFrame" => array(
                    "within_24_hours" => 20.00,
                    "within_1_2_days" => 80.00,
                    "within_3_5_days" => 50.00,
                    "within_1_2_weeks" => 10.00
                )
            )
        )
    )
);

What I would like to do is retrieve the numeric value based on the type_of_work and timeFrame criteria given by the user.

Example1:
search the sub array “text”, given:

  • type_of_work = “option1”
  • timeFrame = “within_24_hours”
  • Then value of “1.00” should be extracted

Example2:
search the sub array “non-text”, given:

  • type_of_work = “option3”
  • timeFrame = “within_24_hours”
  • Then value of “50.00” should be extracted

How can I accomplish 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-05-28T14:46:54+00:00Added an answer on May 28, 2026 at 2:46 pm

    Accessing a multi-dimensional array is just about the same as accessing a one dimensional array.

    Here’s an example based on what you’re asking:

    // this contains the entire "text" dimension.
    $pay_rate_lookup['text'];
    
    // contains the entire type_of_work dimension inside the text dimension.
    $pay_rate_lookup['text']['type_of_work'];
    

    So based on the above examples, keep building out your select until you have the dimension/results you want:

    $pay_rate_lookup['text']['type_of_work']['option1']['timeFrame']['within_24_hours'];
    

    That will return 1.00.

    Use the same method to retrieve 50.00.

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

Sidebar

Related Questions

I have a messy tree multidimensional array that I want to do the following
I want to make a clone of multidimensional Array so that i can play
I want a function that searches through my array, and returns all the children
I have a 2-dimensional array in Ruby that I want to produce a working
Say you have the following ANSI C code that initializes a multi-dimensional array :
I have just noticed that a multidimensional array in C# does not implement IEnumerable<T>
I would like to search key in multidimensional array and i would like to
I have the following multidimensional array: Array ( [0] => Array ( [area] =>
I have create following string multidimensional array in java. which has top outer array
I have a page that searches a database and generates the following array. I'd

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.