Guest User

Untitled

a guest
Feb 24th, 2018
101
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.90 KB | None | 0 0
  1. <?php
  2. // for ($i = 1; $i <= 100; $i++)
  3. // {
  4. // echo $i. '. line '.$i."<br>";
  5. // }
  6.  
  7. // $studentArr = array (
  8. // "Arabi" => 3.66,
  9. // "Larabi" => 2.66,
  10. // "Marabi" => 3.70,
  11. // "Sohan" => 4.00,
  12. // "Mohan" => 3.66,
  13. // "Afif" => 3.66,
  14. // );
  15. //
  16. // foreach ($studentArr as $key => $value)
  17. // {
  18. // echo "Student Name: [" . $key. "] and CGPA: [".$value." ]<br>";
  19. // }
  20.  
  21. // top half of the diamond
  22. for ($row = 1; $row <= 5; $row++) {
  23. for($space = 1; $space <= 5 - $row; $space++) {
  24. echo "&nbsp&nbsp";
  25. }
  26.  
  27. for($star = 1; $star <= 2 * $row - 1; $star++) {
  28. echo "*";
  29. }
  30.  
  31. echo "<html><br><html>";
  32. }
  33.  
  34.  
  35. for ($row = 4; $row >= 1; $row--) {
  36. for($space = 1; $space <= 5 - $row; $space++) {
  37. echo "&nbsp&nbsp";
  38. }
  39.  
  40. for($star = 1; $star <= 2 * $row - 1; $star++) {
  41. echo "*";
  42. }
  43.  
  44. echo "<html><br><html>";
  45. }
  46.  
  47.  
  48.  
  49.  
  50.  
  51. ?>
Add Comment
Please, Sign In to add comment