Skip to content

Instantly share code, notes, and snippets.

@PHLAK
Created January 24, 2012 22:30
Show Gist options
  • Save PHLAK/1673128 to your computer and use it in GitHub Desktop.
Save PHLAK/1673128 to your computer and use it in GitHub Desktop.
<?php
for ($x = 1; $x <= 100; $x++) {
if ($x % 3 === 0 && $x % 5 === 0) {
echo 'FizzBuzz';
} elseif ($x % 3 === 0) {
echo 'Fizz';
} elseif ($x % 5 === 0) {
echo 'Buzz';
} else {
echo $x;
}
echo "<br>";
}
?>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment