Created
May 26, 2017 19:33
-
-
Save YurePereira/0b88b4b3ac3172a30a4b23664fa6c1c3 to your computer and use it in GitHub Desktop.
Usando o comando break no laço while
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 | |
| $contador = 0; | |
| while (true) {//Loop infinito. | |
| if ($contador >= 5) { | |
| break; | |
| } | |
| echo $contador++ . PHP_EOL; | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment