Skip to content

Instantly share code, notes, and snippets.

@alnorris
Last active December 23, 2015 01:49
Show Gist options
  • Save alnorris/6562389 to your computer and use it in GitHub Desktop.
Save alnorris/6562389 to your computer and use it in GitHub Desktop.
FizzBuzz implementation in PHP.
for($i = 1; $i <= 100; $i++) {
if(($i % 3) == 0 || ($i % 5) == 0) {
if(($i % 3) == 0) { echo "Fizz"; }
if(($i % 5) == 0) { echo "Buzz"; }
}
else { echo $i; }
echo "<br />";
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment