html5andphp: Making Flage using loop in php

Monday, 24 June 2013

Making Flage using loop in php


Loops in php

This type of flag creating using nested loops . Big deal of loops.          

flag                     


Php code



<!doctype html>
<html>
<head></head>
<body>

<?php
for ( $b =1;$b<=6;$b++ )
{
echo"&nbsp &nbsp &nbsp &nbsp &nbsp &nbsp &nbsp &nbsp";
 for ($c=1;$c<=20;$c++)
   {
   echo"*";
 
   }
 
     echo"<br>";
 
 }

 for ($a=1;$a<=10;$a++)
   {
   echo"&nbsp &nbsp &nbsp &nbsp &nbsp &nbsp &nbsp &nbsp";
   echo"***";
   echo"<br>";
   }

   $a=3;
for ( $b = 1 ; $b <= 4 ; $b++ )
{
 for ( $c = 1 ; $c <= $a ; $c++ )
   {
    echo"&nbsp &nbsp &nbsp";
}
    $a--;
      for ( $c = 1 ; $c <= 2*$b - 1 ; $c++ )
   {
         echo"***";
        }
      echo"<br>";
 }
 
?>
<b>uk</b>
</body>
</html>






For more on php visit php-tutorial