Skip to content

Instantly share code, notes, and snippets.

Last active May 1, 2017
What would you like to do?
Next time someone asks you to take a FizzBuzz Test...
$biggest =100;
$all_numbers = range(0,$biggest);
$threes = array_fill_keys(range(3, $biggest, 3), 'Fizz');
$fives = array_fill_keys(range(5, $biggest, 5), 'Buzz');
$fifteens = array_fill_keys(range(15, $biggest, 15), 'FizzBuzz');
$all_numbers = array_replace($all_numbers, $threes, $fives, $fifteens);
Copy link

jrmadsen67 commented Aug 21, 2013

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment