I have 2 arrays and I need to make a comparison between them, to find which values are missing in the second array ( $arrayxml
), for example:
$arraybd=array('1','2','3','4');
$arrayxml=array('1','2');
In this case, the values '3'
and '4'
are missing in $arrayxml
, so I would get those values '3'
and '4'
to be able to execute the task I need (I'll remove it from the database).
The ideal would be to generate a string, or even an array with the values that are missing, in the case above, would be:
$valoresdiferentes=('3','4')
What is the best way to do this?