I need to find the differences between two arrays with the following structure:
array([0] => array([ciudad] => "Londres" [pais] => "Inglaterra") [1] => array([ciudad] => "París" [pais] => "Francia")... [n] => array([ciudad] => "Roma" [pais] => "Italia"))
When trying to apply array_diff I get an empty array even though there are pairs (city, country) in the first array that are not in the second; I think the problem is that the function is not able to enter the internal arrays and sees them all the same.
I am trying to make a more elaborate comparison through an if inside a for loop but it is not giving good results either:
$localizaciones_distintas = array();
for ($i = 0; $i < count($localizaciones_bd); $i++)
{
if ($localizaciones[$i] != $localizaciones_bd[$i]) array_push($localizaciones_distintas, $localizaciones[$i]);
}
Can you think of how to solve it?
Thanks in advance.