It is necessary to compare several arrays for matching values.
$result = array_intersect($var_1,$var_2,$var_3,$var_4,$var_5,$var_6,$var_7); If there is an array, then we transfer it, if not, then we compare the others for each of them. If there is no $var_2 , but there are others, then compare it with $result = array_intersect($var_1,$var_3,$var_4,$var_5,$var_6,$var_7); if there is no $var_5,$var_6 , but there are others, then compare it as $result = array_intersect($var_1,$var_2,$var_3,$var_4,$var_7); And so on.
$var_Nnot defined? - Sergiks$var_1always exists. - Torawhite