$arr1 = array(
'a' => 123,
'b' => 123,
'c' => 123,
'd' => 123,
);
$arr2 = ('a', 'b', 'c', 'd', 'e');
How can I remove elements from $arr2 that don’t exist as keys in $arr1 ?
for example e doesn’t exist as key in $arr1 so it should be removed
it computes intersection of two sets –
$arr2values and$arr1keys