Created
November 18, 2017 06:57
-
-
Save uniacid/58ca4f13a58a2ad1de992324fde22c4d to your computer and use it in GitHub Desktop.
Fizz Buzz
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
<?php | |
function fizzbizz() | |
{ | |
for ($i = 0; $i <= 100; $i++) { | |
if ( ($i % 3 == 0) && ($i % 5 == 0) ) { | |
echo "FizzBuzz\r\n"; | |
} elseif ($i % 3 == 0) { | |
echo "Fizz\r\n"; | |
} elseif ($i % 5 == 0) { | |
echo "Buzz\r\n"; | |
} else { | |
echo $i."\r\n"; | |
} | |
} | |
} | |
fizzbizz(); | |
?> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment