how to compare two array value and remove the duplicate value from the first array using php for example
$a = ['a','b','c','d','e','f'];
$b = ['a','e'];
$result_array = ['b','c','d','f'];
I tried this:
$a = ['a','b','c','d','e','f'];
$b = ['a','e'];
foreach($a as $key_a=>$val_a){
$val = '';
foreach($b as $key_b=>$val_b){
if($val_a != $val_b){
$val = $val_a;
}else{$val = $val_b;}
}
echo $val."<br>";
}