Skip to content

Instantly share code, notes, and snippets.

@YurePereira
Created May 22, 2017 23:00
Show Gist options
  • Select an option

  • Save YurePereira/53ff03d8e4c9bb076b84c4c91ce4e453 to your computer and use it in GitHub Desktop.

Select an option

Save YurePereira/53ff03d8e4c9bb076b84c4c91ce4e453 to your computer and use it in GitHub Desktop.
Exemplo 2 usando laço de repetição FOR, segunda expressão.
<?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