I have two arrays:
$to_import = Array(
[0] => Array(['native_id'] => 35339920, ['type'] => product)
[1] => Array(['native_id'] => 22045872, ['type'] => product)
[2] => Array(['native_id'] => 25913185, ['type'] => profile)
[3] => Array(['native_id'] => 14354407, ['type'] => profile)
)
$existing = Array(
[0] => Array(['native_id'] => 22045872)
[1] => Array(['native_id'] => 25913185)
[2] => Array(['native_id'] => 30836971)
)
I need to remove the record from the first array when the id is found in the second array, and when type matches 'profile'. So in this example, three remain:
$to_import = Array(
[0] => Array(['native_id'] => 35339920, ['type'] => product)
[1] => Array(['native_id'] => 22045872, ['type'] => product)
[3] => Array(['native_id'] => 14354407, ['type'] => profile)
)
I have found similar questions, but I can't work out how to apply them to my requirements. This answer looks like it is close to what I want, but I can't get it to work, my knowledge is failing me.
22045872remain?