Skip to content

Instantly share code, notes, and snippets.

@YurePereira
Created May 26, 2017 19:33
Show Gist options
  • Select an option

  • Save YurePereira/0b88b4b3ac3172a30a4b23664fa6c1c3 to your computer and use it in GitHub Desktop.

Select an option

Save YurePereira/0b88b4b3ac3172a30a4b23664fa6c1c3 to your computer and use it in GitHub Desktop.
Usando o comando break no laço while
<?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