Initial data commit
This commit is contained in:
parent
72d218235f
commit
f23f22d71c
199087 changed files with 3378941 additions and 0 deletions
15
Task/Loops-Nested/PHP/loops-nested.php
Normal file
15
Task/Loops-Nested/PHP/loops-nested.php
Normal file
|
|
@ -0,0 +1,15 @@
|
|||
<?php
|
||||
for ($i = 0; $i < 10; $i++)
|
||||
for ($j = 0; $j < 10; $j++)
|
||||
$a[$i][$j] = rand(1, 20);
|
||||
|
||||
foreach ($a as $row) {
|
||||
foreach ($row as $element) {
|
||||
echo " $element";
|
||||
if ($element == 20)
|
||||
break 2; // 2 is the number of loops we want to break out of
|
||||
}
|
||||
echo "\n";
|
||||
}
|
||||
echo "\n";
|
||||
?>
|
||||
Loading…
Add table
Add a link
Reference in a new issue