Created
May 22, 2017 23:00
-
-
Save YurePereira/53ff03d8e4c9bb076b84c4c91ce4e453 to your computer and use it in GitHub Desktop.
Exemplo 2 usando laço de repetição FOR, segunda expressão.
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 | |
| for ($condicao = true, $contador = 1; $condicao;) { | |
| if ($contador > 4) { | |
| $condicao = false; | |
| } | |
| echo ($contador ++) . PHP_EOL; | |
| } | |
| /* | |
| Saída: | |
| 1 | |
| 2 | |
| 3 | |
| 4 | |
| 5 | |
| */ |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment