I want to display the output as like this
1 1
12 21
123 321
1234 4321
1234554321
Here is my php code
for($i=1;$i <= 5;$i++)
{
for($j=1;$j<=$i;$j++)
{
// print the result
echo "$j";
}
for($y=$i;$y<=$i;$y++)
{
echo ' ';
}
for($k=$i;$k>=1;$k--)
{
// print the result
echo " $k";}
echo "<br/>";
}
But I got the output like this
1 1
12 2 1
123 3 2 1
1234 4 3 2 1
12345 5 4 3 2 1
Please help me get an output like above.