Advertisement
Guest User

Untitled

a guest
Mar 22nd, 2018
84
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.35 KB | None | 0 0
  1. <!DOCTYPE html>
  2. <html>
  3. <head>
  4. <title>PHP Chapter 1: Binary Christmas Tree</title>
  5. </head>
  6. <body>
  7. <?php
  8. xmas(3);
  9. function xmas($num) {
  10. $row = $num;
  11. $c = 1;
  12. for($row;$row>0;$row--){
  13. echo str_repeat('&nbsp', $row);
  14. for($i=$row;$i<=$num;$i++) {
  15. echo ($c % 2) . ' ';
  16. $c++;
  17. }
  18. echo "<br/>";
  19. }
  20. }
  21. ?>
  22. </body>
  23. </html>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement