Created
August 9, 2015 19:49
-
-
Save VictorFursa/5ba6a809233f4ff4ae7e 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
<?php | |
$a = array(array(10, 2, 12), array(15,19,7), array(1,5,16) ); | |
$min = $a[0][0]; | |
for($i = 0;$i < count($a);$i++){ | |
for ($j = 0; $j < count($a[$i]); $j++){ | |
if($a[$i][$j] < $min) | |
$min = $a[$i][$j]; | |
} | |
} | |
echo $min; | |
echo "<br>"; | |
$a = array(array(10, 2, 12), array(15,19,7), array(1,5,16) ); | |
$min = $a[0][0]; | |
foreach ($a as $item){ | |
foreach ($item as $item2){ | |
if($min > $item2) | |
$min = $item2; | |
} | |
} | |
echo $min; | |
?> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment