Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
FizzBuzz solution in PHP
for ($i = 1; $i <= 100; $i++)
{
if($i % 3 == 0 && $i % 5 ==0){
echo "FizzBuzz<br />";
}
else if($i % 3 == 0){
echo "Fizz<br />";
}
else if($i % 5 == 0){
echo "Buzz<br />";
}
else {
echo $i."<br />";
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.