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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 13, 20262026-05-13T16:31:16+00:00 2026-05-13T16:31:16+00:00

array 324545432 => array 0 => array ‘Age’ => int 1 ‘Status’ => string

  • 0
array
  324545432 => 
    array
      0 => 
        array
          'Age' => int 1
          'Status' => string 'INSTALLED' 
          'Id' => string '830026495' 
          'name' => string 'TV' 
      1 => 
        array
          'Age' => int 2
          'Status' => string 'GOOD' 
          'Id' => string '553718299' 
          'name' => string 'Computer'

O/P Array should be of Structure:

    array
      0 => 
        array
          'Age' => int 0
          'Status' => string 'INSTALLED/GOOD' 
          'Id' => string '830026495' 
          'name' => string 'TV' 
      1 => 
        array
          'Age' => int 0
          'Status' => string 'INSTALLED/GOOD' 
          'Id' => string '553718299' 
          'name' => string 'Computer'               

Update:

Input Array:

array
  324545433 => 
    array
      0 => 
        array
          'Age' => int 0
          'Status' => string 'INSTALLED/GOOD' 
          'Id' => string '830026495' 
          'name' => string 'TV' 
      1 => 
        array
          'Age' => int 0
          'Status' => string 'INSTALLED/GOOD' 
          'Id' => string '553718299' 
          'name' => string 'Computer'         
array
  324545432 => 
        array
          0 => 
            array
              'Age' => int 0
              'Status' => string 'INSTALLED/GOOD' 
              'Id' => string '830026495' 
              'name' => string 'TV' 
          1 => 
            array
              'Age' => int 0
              'Status' => string 'INSTALLED/GOOD' 
              'Id' => string '553718299' 
              'name' => string 'Computer'
array
  324545431 => 
        array
          0 => 
            array
              'Age' => int 0
              'Status' => string 'INSTALLED/GOOD' 
              'Id' => string '830026495' 
              'name' => string 'TV' 
          1 => 
            array
              'Age' => int 0
              'Status' => string 'INSTALLED/GOOD' 
              'Id' => string '553718299' 
              'name' => string 'Computer'
array
  324545434 => 
        array
          0 => 
            array
              'Age' => int 0
              'Status' => string 'INSTALLED/GOOD' 
              'Id' => string '830026495' 
              'name' => string 'TV' 
          1 => 
            array
              'Age' => int 0
              'Status' => string 'INSTALLED/GOOD' 
              'Id' => string '553718299' 
              'name' => string 'Computer'
array
  324545430 => 
        array
          0 => 
            array
              'Age' => int 0
              'Status' => string 'INSTALLED/GOOD' 
              'Id' => string '830026495' 
              'name' => string 'TV' 
          1 => 
            array
              'Age' => int 0
              'Status' => string 'INSTALLED/GOOD' 
              'Id' => string '553718299' 
              'name' => string 'Computer'

.
.
.
.
.

Output Required:

    array
      0 => 
        array
          'Age' => int 0
          'Status' => string 'INSTALLED/GOOD' 
          'Id' => string '830026495' 
          'name' => string 'TV' 
      1 => 
        array
          'Age' => int 0
          'Status' => string 'INSTALLED/GOOD' 
          'Id' => string '553718299' 
          'name' => string 'Computer'
     2 => 
        array
          'Age' => int 0
          'Status' => string 'INSTALLED/GOOD' 
          'Id' => string '830026495' 
          'name' => string 'TV' 
      3 => 
        array
          'Age' => int 0
          'Status' => string 'INSTALLED/GOOD' 
          'Id' => string '553718299' 
          'name' => string 'Computer'
      4 => 
        array
          'Age' => int 0
          'Status' => string 'INSTALLED/GOOD' 
          'Id' => string '830026495' 
          'name' => string 'TV' 
      5 => 
        array
          'Age' => int 0
          'Status' => string 'INSTALLED/GOOD' 
          'Id' => string '553718299' 
          'name' => string 'Computer'
      6 => 
        array
          'Age' => int 0
          'Status' => string 'INSTALLED/GOOD' 
          'Id' => string '830026495' 
          'name' => string 'TV' 
      7 => 
        array
          'Age' => int 0
          'Status' => string 'INSTALLED/GOOD' 
          'Id' => string '553718299' 
          'name' => string 'Computer'     
      8 => 
        array
          'Age' => int 0
          'Status' => string 'INSTALLED/GOOD' 
          'Id' => string '830026495' 
          'name' => string 'TV' 
      9 => 
        array
          'Age' => int 0
          'Status' => string 'INSTALLED/GOOD' 
          'Id' => string '553718299' 
          'name' => string 'Computer'

How can we achieve this ? Thing to note is that we can have many layers of ‘3242524621’ like numbers which are associative array.

Thanks.

  • 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-13T16:31:17+00:00Added an answer on May 13, 2026 at 4:31 pm

    This will set $new_array to the first value of $original_array no matter what the key is.

     function get_first($original_array)
     {
        foreach($original_array as $array)
        {
            return $array;
        }
    }
    $array = get_first($other_array);
    

    You could also try array_shift() which will get the first value of $original_array, remove if from $original_array and return it, thus that the removed value is now set to $new_array

    $new_array = array_shift($original_array);
    

    You could probably make another function similar to the top one that would get rid of the destructive element.

    function get_first($array)
    {
        return array_shift($array);
    }
    

    Because arrays are passed by value and not reference, the array you pass into that function will remain intact.

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

Sidebar

Ask A Question

Stats

  • Questions 310k
  • Answers 310k
  • Best Answers 0
  • User 1
  • Popular
  • Answers
  • Editorial Team

    How to approach applying for a job at a company ...

    • 7 Answers
  • Editorial Team

    What is a programmer’s life like?

    • 5 Answers
  • Editorial Team

    How to handle personal stress caused by utterly incompetent and ...

    • 5 Answers
  • Editorial Team
    Editorial Team added an answer There was another error produced on that page. One that… May 13, 2026 at 10:13 pm
  • Editorial Team
    Editorial Team added an answer which is then passed to "const A& operator+( int m… May 13, 2026 at 10:13 pm
  • Editorial Team
    Editorial Team added an answer Not sure exactly what you are asking, but I would… May 13, 2026 at 10:13 pm

Related Questions

Array 1 | Array 2 ================= 1 | 2 2 | 3 3 |
Array $imagelist: Array ( [additional] => Array ( [count] => 2 [image] => Array
Array ( [kanye] => Array ( [0] => Kanya [1] => Janaye [2] =>
array(1) { [0]=> string(8) outgoing } bool(false) array(1) { [0]=> string(8) outgoing } bool(false)
Array.Sort(test); Comes out to be _A _B _C A B C I reverse it

Trending Tags

analytics british company computer developers django employee employer english facebook french google interview javascript language life php programmer programs salary

Top Members

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.