Skip to content

Instantly share code, notes, and snippets.

@tfevens
Created November 21, 2012 16:03
Show Gist options
  • Save tfevens/4125679 to your computer and use it in GitHub Desktop.
Save tfevens/4125679 to your computer and use it in GitHub Desktop.
<?php
for($i=1;$i<=100;$i++) {
if (($i % 3) == 0 AND ($i % 5) != 0) {
echo 'Fizz'."<br>";
}
elseif (($i%3)!=0 AND ($i%5)==0) {
echo 'Buzz'."<br>";
}
elseif (($i%3)==0 AND ($i%5)==0) {
echo 'FizzBuzz'."<br>";
}
else {
echo $i."<br>";
}
}
?>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment