Last active
May 29, 2016 04:55
-
-
Save adzimzf/c07028edc4b76c35ad8c541f91e1cfbe to your computer and use it in GitHub Desktop.
This file contains 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 | |
$a=10; | |
for ($i=1; $i < $a-1; $i++) { | |
for ($j=($a-$i); $j > 1 ; $j--) { | |
echo " "; | |
} | |
for ($k=1; $k < $i-1; $k++) { | |
echo "*"; | |
} | |
for ($l=1; $l < $i-2 ; $l++) { | |
echo "*"; | |
} | |
echo PHP_EOL; | |
} | |
for ($i=1; $i <$a ; $i++) { | |
for ($j=1; $j <$i ; $j++) { | |
echo " "; | |
} | |
for ($k=($a+1-$i-2); $k >1 ; $k--) { | |
echo "*"; | |
} | |
for ($l=($a-$i-2); $l >1 ; $l--) { | |
echo "*"; | |
} | |
echo PHP_EOL; | |
} | |
?> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment