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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 11, 20262026-06-11T09:33:27+00:00 2026-06-11T09:33:27+00:00

Well, not sure I am going to be able to write this out to

  • 0

Well, not sure I am going to be able to write this out to well, but I will try.
From a backend script I can’t really change up to much. I have a very large multi-dimensional array being spit out to the UI where the array’s within the main array dont contain your normal 0-n index scheme, and they are generated off the backend due to the association they have. So I have for example a piece of the multi-dimensional array that looks like

Array(
     [0] = Array(
               [stuff] = 'something'
               [morestuff] = 'other'
               [info] = array(
                               [generated_id_based_on_assication] = array(
                                                              [id] = '12345t'
                                                              [desc] = 'blah blah'
                                                              [url] = '/some/where'
                                                              )
                               [generated_id_based_on_assication] = array(
                                                              [id] = '12345t'
                                                              [desc] = 'blah blah'
                                                              [url] = '/some/where'
                                                              )
                               [generated_id_based_on_assication] = array(
                                                              [id] = '12345t'
                                                              [desc] = 'blah blah'
                                                              [url] = '/some/where'
                                                              )
                               [generated_id_based_on_assication] = array(
                                                              [id] = '12345t'
                                                              [desc] = 'blah blah'
                                                              [url] = '/some/where'
                                                              )
                        )
              ),
     [1] = Array(
               [stuff] = 'something'
               [morestuff] = 'other'
               [info] = array(
                               [generated_id_based_on_assication] = array(
                                                              [id] = '12345t'
                                                              [desc] = 'blah blah'
                                                              [url] = '/some/where'
                                                              )
                               [generated_id_based_on_assication] = array(
                                                              [id] = '12345t'
                                                              [desc] = 'blah blah'
                                                              [url] = '/some/where'
                                                              )
                               [generated_id_based_on_assication] = array(
                                                              [id] = '12345t'
                                                              [desc] = 'blah blah'
                                                              [url] = '/some/where'
                                                              )
                               [generated_id_based_on_assication] = array(
                                                              [id] = '12345t'
                                                              [desc] = 'blah blah'
                                                              [url] = '/some/where'
                                                              )
                        )
              )
       )

I know not the best representation of an array. But for the sake of example as I can’t post the actual data itself what I need to do is for the [info] array find each generated_id_based_on_assication so I can pull data from each generated_id_based_on_assication array. But seeing as its not a 0-n index Im not sure how to grab that “generated_id_based_on_assication” part so I can work with the data within it, as running it through a foreach or any type of loop really isn’t an option for that particular array within the arrays. Anyone have a suggestion? If I was able to run this through a loop I could do it, but thats where im tripped up I can’t as this data is being listed in tables, and everything is on a per row basis for that array.

  • 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-11T09:33:28+00:00Added an answer on June 11, 2026 at 9:33 am

    Assuming your outer array is in a variable called $array.. Try

    $keys = array_keys($array[0]['info']);
    

    and then $keys will contain the generated ids and you can use them like this

    $desc = $array[0]['info'][$keys[0]]['desc'];
    

    http://php.net/manual/en/function.array-keys.php

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

Sidebar

Related Questions

I am not sure I am going to be able to explain this one
I'm not sure that title is worded very well, but not sure how else
I have the following script that works well in Firefox and Chrome (not sure
Ok not sure whats going on the code does toggle class, but when you
I'm not sure if this is possible, but various posts in the ExpressionEngine forums
I'm not sure if I phrased my question as well as I liked to
My question is probably not well phrased and it's probably a dupe but here
This is a homework question. Frankly, I'm not sure how a C program delivers
I've done some searching (maybe I'm not describing my problem well enough) but haven't
So I'm not sure how stackoverflow friendly this question is since it doesn't have

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.