php loop to print alphabet pattern V
php loop to print alphabet pattern V
Example :-
<?php
echo "<pre>";
//loop for row
for($row=0;$row<7; $row++){
//loop for column
for($col=0;$col<=7;$col++)
{
//condition determine print echo '*'
value
if((($col==1 or $col==5) and $row <5)or
($row==6 and $col==3)or ($row==5 and
($col==2 or $col ==4)))
echo "*";
//print condition met
else
echo " ";
//if condition
}
echo "<br>"; }
echo "</pre>";
?>
php loop to print alphabet pattern V
output :-
Related Post :-
Post a Comment