Makes sense of course, don’t know what I was thinking. Do you perchance know of any technique to compare 2 multidimensional arrays? I need to compare the arrays and then do something with those key/value pairs that aren’t in both arrays. Been trying various things all day long.
This is what one of those arrays would look like:
array (size=3)
0 =>
array (size=2)
'id' => int 6
'value' => int 0
1 =>
array (size=2)
'id' => int 6
'value' => int 1
2 =>
array (size=2)
'id' => int 5
'value' => int 0
Thanks for your help and I hope you’re well by the way.
Define ‘compare’. What’re you trying to get out of it? How are you defining what key/value pairs aren’t in both arrays? If i have id = 6 in both arrays but different values, is it a match or not? What about multiple values for the same ID?
@rpkamp, thanks but I receive some kind of offset error.
Array1 might have id6 value0, id6 value1, and id5 value0. Array2 might only have id5 value0. The array I wish to create would contain id6 value0 and id6 value1, both of which are missing from Array2.
please excuse my delayed response, I haven’t had an opportunity to test the code. Thank you for posting the function. I did try it but haven’t managed to get it working. It either returns an empty array or it returns all of the contents from one of the arrays, i.e., the same array.
Will try again later, perhaps I did something wrong. Thanks!