Use array_diff() to find elements present in one array but not in others.
Source Code
$array1 = ['a', 'b', 'c', 'd'];
$array2 = ['b', 'd'];
$difference = array_diff($array1, $array2);
print_r($difference); // Outputs: Array ( [0] => a [2] => c )
Use array_diff() to find elements present in one array but not in others.
$array1 = ['a', 'b', 'c', 'd'];
$array2 = ['b', 'd'];
$difference = array_diff($array1, $array2);
print_r($difference); // Outputs: Array ( [0] => a [2] => c )