Created
August 11, 2015 19:48
-
-
Save VictorFursa/1f025236fd3586df2e7c to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// 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