Below, there are some patterns related to star, number and alphabets that are also asked in interview to test your logic. Some below:
";
}
?>
![](https://educatech.in/wp-content/uploads/2023/07/Screen-Shot-2019-10-15-at-11.57.12-AM-e1571120923850.png)
=1;$i--)
{
for($j=0;$j<$i;$j++)
{
echo "*";
}
echo "
";
}
?>
![](https://educatech.in/wp-content/uploads/2023/07/Screen-Shot-2019-10-15-at-12.02.06-PM-e1571121240513.png)
";
}
?>
![](https://educatech.in/wp-content/uploads/2023/07/Screen-Shot-2019-10-15-at-12.05.23-PM-e1571121483629.png)
";
}
?>
![](https://educatech.in/wp-content/uploads/2023/07/Screen-Shot-2019-10-15-at-12.09.04-PM-e1571121650449.png)
=$i; $j--)
{
echo " ";
}
for($k=1; $k<=$i; $k++)
{
echo $k." ";
}
for($m=($i-1); $m>=1; $m--)
{
echo $m." ";
}
echo "
";
}
?>
![](https://educatech.in/wp-content/uploads/2023/07/Screen-Shot-2019-10-15-at-12.12.25-PM-e1571121811803.png)
=($i + 1); $j--)
{
echo " ";
}
for($k=1; $k<=$i; $k++)
{
echo "*"." ";
}
for($m=2; $m<=$i; $m++)
{
echo "*"." ";
}
echo "
";
}
?>
![](https://educatech.in/wp-content/uploads/2023/07/Screen-Shot-2019-10-15-at-12.14.32-PM-e1571121987271.png)