I'm trying to print the '#' character a certain number of times where the number of times is $height2
. I tried running it, but it only printed 8 0's instead of the #s.
This is my code:
<?php
$height = $_REQUEST['height'];
$height2 = "0";
$height3 == $height;
echo "<p>You have requested a height of $height" . "." . "</p>";
while ($height2 < $height - 1)
{
echo " " * $height2 . "#" * $height;
$height2 = $height2 + 1;
$height3 = $height - 1;
}
?>
I'm also trying to make each line on separate rows, longest on bottom, then second longest above it etc.
thanks!