Write a program to generate pyramid of stars.
This is the most commonly asked question to beginners. Though this seems to be very complex during my school days, but not.
Program to generate/draw pyramid of stars/asterisks in php
<?php echo '<pre>'; $horizontal = 10; $vertical = 10; while ($vertical--) echo str_repeat(' ', $vertical) . str_repeat('* ', $horizontal - $vertical) . "\n"; echo '</pre>'; ?>