ph4x35ccb

while na pratica

Feb 28th, 2019
148
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 0.68 KB | None | 0 0
  1. <?php
  2. header("Content-Type: text/html; charset=utf-8");
  3.  $a = 20;
  4.  
  5.  while($a < 30){
  6.     $a++;
  7.  }
  8.  var_dump($a);
  9. echo "<br>";
  10.  
  11. $i = 0;
  12.  
  13. while ($i < 5){
  14.     $i++;
  15.     echo "<h{$i}>Iteraçao<h$i>";
  16. }
  17. echo "<br>";
  18.  $a = 20;
  19.  
  20.  while($a <30):
  21.     $a++;
  22.     echo"{$a} ";
  23.  endwhile;
  24.  
  25.  var_dump($a);
  26.  echo"<br>";
  27.  for ($i = 10; $i < 41; $i++){ // notase a diferença do laço ao printar na tela
  28.     echo $i;
  29.  }
  30.  echo"<br>";
  31.  $i = 9;
  32.  while($i < 40):
  33.     $i++;
  34.     echo "{$i}";
  35.  endwhile;
  36.  echo "<br><br><h2>Estrutura de repetiçao</h2>";
  37. $cont=-10;
  38. while ($cont<=10){
  39.     echo"loop=>{$cont}.<br>";;
  40.     $cont++;
  41. }
  42. var_dump($cont);
  43. //https://www.facebook.com/groups/353340335260087/
  44.  
  45.  
  46. ?>
Advertisement
Add Comment
Please, Sign In to add comment