Can't seem to figure out where it's not working. In the center I need a line wiht only ++++++. But I can't seem to find it to work. I've got it to work with a while-loop and a for loop but not the do while loop.
It's gotta look like this
-------+
------++
-----+++
----++++
---+++++
--++++++
-+++++++
++++++++
-+++++++
etc. But the middle line is not a a full line of + characters.
<?php
echo"<p>Do While loop</p>";
$x1=8;
$x2=1;
do {
$x3=1;
do {
echo"--";
$x3++;
}while($x3<$x1);
$x4=1;
do {
echo"+";
$x4++;
}while($x4<=$x2);
echo"<br>";
$x1--;
$x2++;
}while($x1>=0 and $x2<=8);
$y1=1;
$y2=7;
do {
$y3=1;
do {
echo"--";
$y3++;
}while($y3<=$y1);
$y4=1;
do {
echo"+";
$y4++;
}while($y4<=$y2);
echo"<br>";
$y1++;
$y2--;
}while($y1<=7 and $y2>=1);
?>