I have two arrays of the form
Array1:
[0]=> Array([name] => foo [id] => 12)
[1]=> Array([name] => bar [id] => 34)
Array2:
[0]=>Array([name] => bar [id]=> 34)
[1]=>Array([name] => baz [id]=> 56)
The arrays come from a database and any two pairs can have the same name but ID's are unique. I am trying to compare the arrays by ID likes so:
$one_not_two = array_diff($array1[id], $array2[id]);
but that does not return anything. I also tried
$one_not_two = array_diff($array1[id], $array2[id]);
which returned an error "argument is not an array." Originally I got around it by extracting the IDs into a one-dimensional array and just comparing those but now a new feature requires me to compare the pairs. Any advice?
PS Our servers are running php 5.3 if that makes any difference.