Fizz Buzz is a game where players sit in a circle and count up to a certain number. However, any number divisible by three is replaced by the word fizz and any divisible by five by the word buzz. Numbers divisible by both become fizz buzz. A player who hesitates or makes a mistake is eliminated from the game.
In these solutions there is obviously only one player, the script, but it's funny to program nevertheless.
solution1.php
is the first solution I came up with. It follow the rules exactly.
solution2.php
is a little bit more advanced, you can add any amount of rules with number to divide and which word to replace them with.