Created
August 23, 2014 09:56
-
-
Save esehara/4032412d67ea36117bda to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?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