Print star pattern using php


 
<?php
// print star pattern
/*
*
**
***
****
*****
*/
for ($i=1; $i<=5; $i++)
{
for($j=1;$j<=$i;$j++)
{
echo " * ";
}
echo "\n";
}
?>

 Output:-


 

 

 

 

 

 

 

 

 

No comments:

Post a Comment

theengineerschoice01@gmail.com