Created
August 29, 2017 22:31
-
-
Save sela/30d78a2d48faaf4f2e929fb61f2c4958 to your computer and use it in GitHub Desktop.
This file contains hidden or 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 fizzBuzzWoof($n) | |
{ | |
for ($i=1; $i<=$n; $i++) { | |
$special = false; | |
if ($i % 3 === 0) { | |
echo "Fizz"; | |
$special = true; | |
} | |
if ($i % 5 === 0) { | |
echo "Buzz"; | |
$special = true; | |
} | |
if ($i % 7 === 0) { | |
echo "Woof"; | |
$special = true; | |
} | |
if (!$special) { | |
echo $i; | |
} | |
echo "\n"; | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment