Using PHP, I have an array like this:
Array 1
[
{epid: "123", hash: "xxxxxx"},
{epid: "456", hash: "xxxxxx"},
{epid: "789", hash: "xxxxxx"},
{epid: "123", hash: "xxxxxx"},
{epid: "123", hash: "xxxxxx"},
]
Then, I have a second array like this:
Array 2
[
{epid: "123", name: "This is a title"},
{epid: "456", name: "This is a title"},
{epid: "789", name: "This is a title"}
]
My goal is to get all hash from array one and add them to the appropriate record in array 2. From this example, the results would be:
[
{epid: "123", name: "This is a title", hash: [ xxxxxx, xxxxxx, xxxxxx ] },
{epid: "456", name: "This is a title", hash: [ xxxxxx ] },
{epid: "789", name: "This is a title", hash: [ xxxxxx ] }
]
I'm sure there are multiple loops here, but for the life of me, I can't wrap my brain around it.