Skip to content

Instantly share code, notes, and snippets.

@schierbeck
Created January 14, 2014 22:07
Show Gist options
  • Save schierbeck/8426799 to your computer and use it in GitHub Desktop.
Save schierbeck/8426799 to your computer and use it in GitHub Desktop.
FizzBuzz example
<?php
for($i = 1; $i < 101; $i++) {
if( $i % 3 == 0 ) {
echo 'Fizz';
$fb = true;
}
if( $i % 5 == 0 ) {
echo 'Buzz';
$fb = true;
}
if( !($i % 3 === 0) && !($i % 5 === 0)) {
echo $i;
}
echo '<br>';
}
?>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment