Instantly share code, notes, and snippets.

Embed
What would you like to do?
<?php
function random($occurence = 4, $range = 100){
return rand(1, $range) % $occurence === 0;
}
$count = 0;
for($i=1;$i < 100;$i++){
random($argv[1]) === true ? $count++ : 0;
}
var_dump($count);
?>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment