I need to create a pyramid using asterisks. I specify a value which becomes the base of the pyramid. The base contains as much asterisks as the value specified and the pyram
function pyramid($height) { for ($i = 1; $i <= $height; $i++) { echo str_repeat(" ", $height - $i); echo str_repeat('*', $i * 2 - 1) . ''; } } pyramid(5);