This what I made.It become
1
121
12321
1234321
But I hope I can get
1234321
12321
121
1
I have tried so many times, but I can't make this. Anyone can help??
Do I make some mistake?
<?php
$p=4;
for($x=1;$x<=$p;$x++)
{
for($q=$p;$q>$x;$q--)
{
echo "<center>";
}
for($k=1;$k<$x;$k++)
{
echo $k;
}
if($x>=1)
{
for($v=$x; $v>=1; $v--)
{
echo $v;
}
}
echo "<br>";
}
?>
I would appreciate it, if you can tell me my mistake. Thank You