Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- namespace Codecademy;
- // identical operators - stricter than using equal operator ==
- function agreeOrDisagree($first, $second){
- if ($first === $second){
- return "You agree!";
- } else {
- return "You disagree!";
- }
- }
- echo agreeOrDisagree(5,5);
- echo "\n\n";
- echo agreeOrDisagree("sing", "song");
- function checkRenewalMonth($renewal_month){
- $current_month = date("F"); //using the date function
- if ($current_month === $renewal_month){
- return "Time to renew";
- } else {
- return "Welcome!";
- }
- }
- echo checkRenewalMonth("August"); //month must be captialised for first letter
- echo "\n";
- echo checkRenewalMonth("September");
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement