rows = [
[1, 3, 4],
[1, 2, 3, 5, 6],
[1, 3, 5],
[1, 3, 11]
]
res = set(rows[0])
for row in rows[1:]:
res.intersection_update(row)
$a = array(
array(1,2,4,5,6,7),
array(2,5,7,1),
array(1,2),
array(1,'a','g',2),
);
$res = array();
for($i=0; $i<count($a[0]); $i++){
$flag = 0;
for($j=1; $j<count($a); $j++){
for($k=0; $k<count($a[$j]); $k++){
if($a[0][$i] == $a[$j][$k]){
$flag ++ ;
if($flag == 3){ array_push($res, $a[0][$i]); }
}
} // k
} // j
} // for i
print_r($res);