$arr = array(1,2,4,7,12,17,21,24,26,27);
for($i=1; $i<count($arr); $i++) {
for($j=$arr[$i-1]; $j<$arr[$i]; $j++) {
echo $j;
}
echo "<br>";
}
I am trying to use for loops to make a shape that looks like the diamond shape . at this time it’s look like half diamond shape.
i want to help in this .
This is the best I could come up with:
So what you want is (without the shape):
I’m having trouble getting where the lines break, since the numbers in the array don’t come out to a “symmetrical” number.
Or do you want this: