Friday, May 31, 2024

Program to print square pattern in php

pattern in php


 1] Square pattern in php

Example :-

<?php
for($row =1; $row<=5; $row++)
{
  for($col=1; $col <=5; $col++)
  {
    echo "*";
  }
  echo "</br>";
}
?>


Square pattern in php

Output:-
square pattern in php

2]Square pattern in php

Example :-

<?php
for($row =1; $row<=5; $row++)
{
  for($col=1; $col <=5; $col++)
  {
    echo "A";
//change only echo " "; value eg:- 1,2,3,0,fdl
 
  }
  echo "</br>";
}
?>



Square pattern in php

Output:-
square pattern in php


Related Post :-


No comments:

Post a Comment