Skip to content

Instantly share code, notes, and snippets.

@esehara
Created August 23, 2014 09:56
Show Gist options
  • Save esehara/4032412d67ea36117bda to your computer and use it in GitHub Desktop.
Save esehara/4032412d67ea36117bda to your computer and use it in GitHub Desktop.
<?php
function _11($i) {
echo $i;
}
function _01($i) {
?>Fizz<?php
}
function _10($i) {
?>Buzz<?php
}
function _00($i) {
echo _01($i);
echo _10($i);
}
function fizzbuzz_int ($i, $mod) {
$fizz = $i % $mod;
$fizz = (bool) $fizz;
$fizz = (int) $fizz;
return $fizz;
}
for ($i = 0; $i < 101; $i++) {
$fizz = fizzbuzz_int($i, 3);
$buzz = fizzbuzz_int($i, 5);
$fizzbuzz = "_" . $fizz . $buzz;
echo $fizzbuzz($i);
echo "\n";
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment