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.
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:
This will result in the following array
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.