Please give me the solution for to print a triangle in stars pattern using php language. I used only 2 for loops to finish this.
* *** ***** *******
Here is my code
<?php
for($a=1;$a<=7;$a++)
{
for($b=1;$b<=$a;$b++)
{
echo " *";
}
echo "<br/>";
}
echo " ";
?>
Please help me out.
Aucun commentaire:
Enregistrer un commentaire