Skip to content

Instantly share code, notes, and snippets.

@VictorFursa
Created August 11, 2015 19:48
Show Gist options
  • Save VictorFursa/1f025236fd3586df2e7c to your computer and use it in GitHub Desktop.
Save VictorFursa/1f025236fd3586df2e7c to your computer and use it in GitHub Desktop.
// 2) Вывести Да ИЛИ НЕТ есть ли два одинаковых элемента В разных масивах
$stat = false;
$a = array(array(10,2322, 2), array(15,222,7), array(1,22,3));
for($i = 0; $i < count($a); $i++){
for($j = 0; $j < count($a[$i]); $j++){
if(isset($a[$i+1][$j])){
if($a[$i+1][$j] == $a[$i][$j]){
$stat = true;
}
}
}
}
if($stat){
echo "ПОВТОР ЕСТЬ";
} else {
echo "ПОВТОРА НЕТ";
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment