I know i could do this with a set of loops, but just wondering if there is a more efficient way.
I have a 2D array with columns of 'id' and 'name' (it's dynamic).
And i query my database asking it to return all records that match the list of ids. That's all done.
Does anyone know how i could merge the query results with my initial array.
Long story short, i want to print out the only the names of ids that are in my database.
$array1 = [[1,'bob'],[2,'jim']];
$array2 = [[2,'false','true']];
i'd like output of:
$array3 = [[2,'jim','false','true']]
I guess a better description is that i'd like to inner join two arrays.
foreach
loop and make a query for eachid