Advertisement
Guest User

Untitled

a guest
Feb 17th, 2020
168
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.83 KB | None | 0 0
  1. <!DOCTYPE html>
  2. <html>
  3. <body>
  4.  
  5. <?php
  6. $month = 1;
  7. if ($month < 1 || $month > 12) {
  8. echo "Number not a month";
  9. } else {
  10. switch ($month) {
  11. case 3:
  12. echo "The result is: Spring";
  13. break;
  14. case 4:
  15. echo "The result is: Spring";
  16. break;
  17. case 5:
  18. echo "The result is: Spring";
  19. break;
  20. case 6:
  21. echo "The result is: Summer";
  22. break;
  23. case 7:
  24. echo "The result is: Summer";
  25. break;
  26. case 8:
  27. echo "The result is: Summer";
  28. break;
  29. case 9:
  30. echo "The result is: Autumn";
  31. break;
  32. case 10:
  33. echo "The result is: Autumn";
  34. break;
  35. case 11:
  36. echo "The result is: Autumn";
  37. break;
  38. default:
  39. echo "The result is: Winter";
  40. }
  41. }
  42. ?>
  43.  
  44. </body>
  45. </html>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement