Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <!DOCTYPE html>
- <html>
- <head>
- <title>PHP Chapter 1: Binary Christmas Tree</title>
- </head>
- <body>
- <?php
- xmas(3);
- function xmas($num) {
- $row = $num;
- $c = 1;
- for($row;$row>0;$row--){
- echo str_repeat(' ', $row);
- for($i=$row;$i<=$num;$i++) {
- echo ($c % 2) . ' ';
- $c++;
- }
- echo "<br/>";
- }
- }
- ?>
- </body>
- </html>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement