I've got an array with multiple person-objects in it, this objects look like this:
id: 1,
name: 'Max Muster',
email: 'max.muster@example.com',
language: 'German'
Now, I've got objects in another array, which doesn't look exactly the same:
id: 1,
name: 'Max Muster',
email: 'max.muster@example.com',
language: 'de'
I've got a foreach-loop to loop through array 2 and check if the objects exists in array 1.
foreach($array2 as $entry) {
if(existsInArray($entry, $array1)) {
// exists
} else {
// doesn't exist
}
}
Is there a function to check (like my existsInArray()), if my object exists in the array? I just need to check, if the object-id exists, other attributes doesn't matter.