Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- //előltesztelős ciklusok
- //feltétel vizsgálat után ha igaz akkor lefut a ciklusmagja
- /*
- while()
- {
- ciklus mag;
- }
- */
- $szam = 1;
- while($szam<100){
- echo($szam."<br>");
- $szam++;
- }
- $szam = 1;
- echo("<hr><table border='1'><tr>");
- $color = array(1 => "white", 0 => "black");
- while($szam<=100)
- {
- echo("<td style='width: 30px; height: 30px; background-color: " . $color[$szam%2] . "'>".$szam."</td>");
- if($szam % 10 == 0) echo("</tr><tr>");
- $szam++;
- }
- echo("</tr></table>");
- ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement