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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 2, 20262026-06-02T18:05:01+00:00 2026-06-02T18:05:01+00:00

Hi friends i am working on survey i need to extract an array from

  • 0

Hi friends i am working on survey i need to extract an array from an array stored inside it

how to do it i am looking to extract answer array based on question id for example 13 .

i have the question id with me . answer array is associated with question .

.how to extract the question array and answer array from the main array based on the value of question id for example 13

now if i need the array which has the question id along with its associated id how to do it then from my array structure?

my code is like this

Array
(
    [0] => Array
        (
            [que_info] => Array
                (
                    [question_id] => 13

                    [description] => Overall Customer Satisfaction.




                )

            [answers] => Array
                (
                    [0] => Array
                        (
                            [answer_id] => 45

                            [answer_text] => Very dissatisfied

                        )


                )

        )

    [1] => Array
        (
            [que_info] => Array
                (
                    [question_id] => 14

                    [description] => Progress (often referred to as Task Resolution or similar)


                )

            [answers] => Array
                (
                    [0] => Array
                        (
                            [answer_id] => 52

                            [answer_text] => None

                        )

                    [1] => Array
                        (
                            [answer_id] => 53

                            [answer_text] => Very little

                        )


                        )



                )

        )

any help will be appreciated 🙂

  • 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-02T18:05:03+00:00Added an answer on June 2, 2026 at 6:05 pm

    First off, that’s not a 2D array, that’s an array tree. A 2D array always has an element array[x][y] for every array[x] and never any array[x][y][z].

    Iterate through the array with a foreach, and return an answer list when you find an element with an id corresponding to question_id.

    Example:

      foreach($questions as $question) {
        if($question['que_info']['question_id'] === $questionId)
          return $question['answers'];
      }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a working WAMP environment (Apache Friends). I decided to try Subversion and
I have created an invite friends code, which is properly working if an FB
So in keeping with my last question, I'm working on scraping the friends feed
I am working on a project in which i have implemented Friends invitation using
I am working on a chat application. I need to display friends list in
I'm working on writing a kernel, and I have a few friends working with
My and 2 of my friends finished working on a .NET and Oracle based
hi friends I have been working WCF since past one week. I have written
I have been working with some friends to convert a Matlab Genetic Algorithm to
On a social network I am working on in PHP/MySQL, I have a friends

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.