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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 23, 20262026-05-23T18:43:20+00:00 2026-05-23T18:43:20+00:00

I would like to start off by saying that I have looked a good

  • 0

I would like to start off by saying that I have looked a good amount for this solution, but all I find is the opposite. That is, I’m trying to figure out how to get the value attached to a certain key in the array, but all I can find is grabbing the key by using the value.

Because I can’t find this, I am very tempted to believe that it is a very simple problem, yet I cannot figure it out. I have looked at the array documentation, and all I’ve found is a method using “current,” which will not work for me here.

Let’s say I have an array of arrays which have distinct keys, like this:

$naEUS["A.1.5.3"] = array( 1000 , 879 , 192 );
$naEUS["A.1.5.4"] = array( 1012 , 922 , 456 );

What my goal is, is to do something like:

$var = "A.1.5.3";
$goal = $naEUS[$var];

I do hope it’s not something silly, because I’ve already had one of those today. And please try to remember that, if it is, there is no such thing as a stupid question, just stupid people who don’t ask. I’m just trying to learn here.

I’m trying to avoid any loops, if possible.

Edit1: Evidently this is how you do it, must be something else wrong on my end. Thanks for all the help and I will post my fix when I figure it out.

Edit2: This example is a little less complex than my actual code, I was just assigning $var to something wrong a bit further up.

  • 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-23T18:43:21+00:00Added an answer on May 23, 2026 at 6:43 pm

    Running

    $naEUS["A.1.5.3"] = array( 1000 , 879 , 192 );
    $naEUS["A.1.5.4"] = array( 1012 , 922 , 456 );
    
    $var = "A.1.5.3";
    $goal = $naEUS[$var];
    
    var_dump($goal);
    

    returns:

    array(3) { [0]=> int(1000) [1]=> int(879) [2]=> int(192) }
    

    What were you looking for?

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

Sidebar

Related Questions

I'll start off by saying I'm a noob with all of this, I have
First I would like to start off with the info that I have just
I'd like to start off by saying that I'm a complete beginner when it
I'll start off by saying that it's entirely possible that this isn't possible -
First for all I would like to start by saying I am relatively new
Let me start off by saying that this is my first real Cocoa app.
I'd like to start this off by saying I'm hardly a pro at jQuery,
I want to start off by saying that I have almost no experience with
I would like to start off all my git repositories with an empty initial
Let me start off by saying that this is my first time working with

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.