Advertisement
theloserboy

Segitiga Bintang Dalam PHP (3)

Nov 11th, 2011
298
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.38 KB | None | 0 0
  1. <html>
  2. <head><title> Latihan PHP </title></head>
  3. <body>
  4. <?php
  5.  
  6. $f=9;
  7. $temp = $f;
  8. $e=9;
  9. $tmp = $e;
  10.  
  11. for($x=1; $x<=$e; $x++)
  12. {
  13. for($y=1; $y<=$x; $y++)
  14. {
  15. echo "&nbsp;&nbsp;";
  16. }
  17. for($z=$tmp; $z>=1; $z--)
  18. {
  19. echo "*";
  20. }
  21. for($p=$x; $p<$e; $p++)
  22. {
  23. echo "*";
  24. }
  25. $tmp--;
  26. echo "<br />";
  27. }
  28. ?>
  29. </body>
  30. </html>
  31.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement