Last active
December 31, 2015 18:49
-
-
Save fierroformo/8029160 to your computer and use it in GitHub Desktop.
Pyramid of asterisks
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
$n = 5; | |
for($i = $n; $i>=0; $i--) { | |
echo str_repeat(' ', $i).str_repeat('* ', $n - $i)."<br>"; | |
} | |
?> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment