Created
June 8, 2015 08:10
-
-
Save macodev/c7ce6d75ccafa61d719c to your computer and use it in GitHub Desktop.
Happy Birthday loop
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function happyBirthday($name){ | |
for($i = 0; $i < 4; $i++) { | |
printf("Happy birthday %s!\n", ($i === 2) ? "dear {$name}" : "to you"); | |
} | |
} | |
happyBirthday('PHP'); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment