Created
October 28, 2018 08:19
-
-
Save benznest/36a86c07d6819cee377b0bda90d85ee6 to your computer and use it in GitHub Desktop.
ปริ้นนาฬิกาทราย php
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 | |
$rows = 10; | |
echo"<br>"; | |
// Triangle A | |
for($i=0; $i<$rows; $i++){ | |
for($j=$rows - $i; $j<$rows; $j++){ | |
echo"<font color='white'>O</font>"; | |
} | |
for($j=$i; $j<$rows; $j++){ | |
echo"O"; | |
} | |
for($j=$i; $j<$rows; $j++){ | |
echo"O"; | |
} | |
echo"<br>"; | |
} | |
for($i=1; $i<=$rows; $i++){ | |
for($j=$i;$j<$rows; $j++){ | |
echo"<font color='white'>O</font>"; | |
} | |
for($j=$rows - $i; $j<$rows; $j++){ | |
echo"O"; | |
} | |
for($j=$rows - $i; $j<$rows; $j++){ | |
echo"O"; | |
} | |
echo"<br>"; | |
} | |
?> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment