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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 1, 20262026-06-01T16:28:36+00:00 2026-06-01T16:28:36+00:00

My PHP function outputs separated arrays instead of a numbered indexed arrays.Now the question

  • 0

My PHP function outputs separated arrays instead of a numbered indexed arrays.Now the question is, how can i make these outputs join in one array? If you have any clarifications let me know.

THis is what is currently being outputted.

    Array
(
    [id] => 2
    [name] => Jerry Maxwell
    [upline] => 1
)
Array
(
    [id] => 3
    [name] => Roseann Solano
    [upline] => 1
)
Array
(
    [id] => 4
    [name] => Joshua Doe
    [upline] => 1
)
Array
(
    [id] => 5
    [name] => Ford Maxwell
    [upline] => 1
)
Array
(
    [id] => 6
    [name] => Ryan Solano
    [upline] => 1
)

To something like this:

    Array
(
[0] =>
    [id] => 2
    [name] => Jerry Maxwell
    [upline] => 1
[1] =>
    [id] => 3
    [name] => Roseann Solano
    [upline] => 1
[2] =>
    [id] => 4
    [name] => Joshua Doe
    [upline] => 1
[3] =>
    [id] => 5
    [name] => Ford Maxwell
    [upline] => 1

[4] =>
    [id] => 6
    [name] => Ryan Solano
    [upline] => 1
)

I am looking to this through PHP.

  • 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-01T16:28:37+00:00Added an answer on June 1, 2026 at 4:28 pm

    Your code is outputting several individual arrays. You appear to want them all inside one master array. If that’s the case, rather than print the arrays out, you can push them into a master array:

    $collection = array( array("Foo", "Bar"), array("Fizz", "Buzz") );
    $masterArray = array();
    
    foreach ( $collection as $indArray )
      array_push( $masterArray, $indArray );
    
    print_r( $masterArray );
    

    This will result in the following array

    Array
    (
      [0] => Array
        (
          [0] => Foo
          [1] => Bar
        )
      [1] => Array
        (
          [0] => Fizz
          [1] => Buzz
        )
    )
    

    Of course I’m curious where you’re outputting your data from to begin with. If it’s the case that you already had all of your arrays in a collection to begin with, it may not be necessary to move them into a completely new array.

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

Sidebar

Related Questions

I trying to find function in PHP that can output the binary data. The
Is there a php function that someone can use to automatically detect if an
I have a PHP function that requires can take 3 parameteres... I want to
I wrote a PHP code for prepare jQuery function, which can select multipal values
I have a PHP function that queries a MySQL database and outputs an html
I tried to open a file with fopen() function in PHP and it output
In PHP I have a function, the problem is it will output an extra
in function need key to encrypt string without mcrypt libraly in php function encrypt($str,
I have written a PHP function to take a video embed code that has
Below is an old PHP function I have for a dropdown list for users

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.