<table>
<tr>
<td align="center">
<?PHP
$b = 1;
for ($a=1; $a<=1; $a++)
{
echo $b++;
echo "<br>";
}
$b = 2;
for ($a=1; $a<=2; $a++)
{
echo $b++;
}
echo "<br>";
$b = 4;
for ($a=1; $a<=3; $a++)
{
echo $b++;
}
echo "<br>";
$b = 7;
for ($a=1; $a<=5; $a++)
{
echo $b++;
}
echo "<br>";
$b = 12;
for ($a=1; $a<=5; $a++)
{
echo $b++;
}
echo "<br>";
$b = 17;
for ($a=1; $a<=4; $a++)
{
echo $b++;
}
echo "<br>";
$b = 21;
for ($a=1; $a<=3; $a++)
{
echo $b++;
}
echo "<br>";
$b = 24;
for ($a=1; $a<=2; $a++)
{
echo $b++;
}
echo "<br>";
$b = 26;
for ($a=1; $a<=1; $a++)
{
echo $b++;
}
?>
</td>
</tr>
</table>
Hi all
I am trying to use for loops to make a shape that looks something along the lines of this:
1
23
456
7891011
1213141516
17181920
212223
2425
26
I have managed to do it, but using way too many loops (9), I want to be a little less than this. Anyone have any help?