I have 3 arrays of objects. They look like this:
$arr1,$arr2: Objects with properties like (ID,filename,size, etc).$arrlink: Objects with properties like (file1ID,file2ID, misc). This links 2 of the above objects
What I need to do is combine them into one array so I can write it to a CSV. The 3 need to be linked: File1ID and File2ID to the ID column in the other 2 arrays. I need to be able to pick what properties I want. Here's an example
$arr1[0] = {1,"c:\filename1.txt",1000....}
$arr1[1] = {2,"c:\filename2.txt",2000....}
$arrlink[0] = {1,2,"aaaa")
Desired Result:
newarray[0] = {"c:\filename1.txt", "c:\filename2.txt", "aaaa"}
I know I can foreach through and do this, but was wondering if there was a simpler/more direct way.
Of course, there are many items in each array, but they all link up in a 1 to 1 relationship.