Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Combine 4 different arrays into one

Status
Not open for further replies.

sen5241b

IS-IT--Management
Sep 27, 2007
199
US
I need to combine 4 different arrays into one. Each of the 4 arrays has a different structure. How?
 
That depends on how you want to combine them.

Looping through each one in succession and adding them to the new encompassing array is one way.

But without knowing how the arrays are built, and how they should be added to the one resulting array there's no way to get any more specific than that.

The simplest method of course would be to simply add each array to a key in the one resulting array such as:

Code:
$newArray[]=$oldarray1;
$newArray[]=$oldarray2;
$newArray[]=$oldarray3;
...

This would make each key of the resulting array an array in itself with the architecture of the other arrays.

But I guess there's more to this question than that.


----------------------------------
Phil AKA Vacunita
----------------------------------
Ignorance is not necessarily Bliss, case in point:
Unknown has caused an Unknown Error on Unknown and must be shutdown to prevent damage to Unknown.

Web & Tech
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top