Skip to content

Instantly share code, notes, and snippets.

@phlbnks
Created September 7, 2016 17:49
Show Gist options
  • Save phlbnks/77ccf115bf2f584ce74bdd6142b02550 to your computer and use it in GitHub Desktop.
Save phlbnks/77ccf115bf2f584ce74bdd6142b02550 to your computer and use it in GitHub Desktop.
Modulus helper
<?php
echo '<pre>';
for ($j = 1; $j < 10; $j++) {
for ($k = 0; $k < $j; $k++) {
echo "\n\$i % $j == $k: \n";
for ($i = 0; $i < 10; $i++) {
echo "$i : ";
if ($i % $j == $k) {
echo "TRUE";
}
echo " \n";
}
}
}
echo '</pre>';
?>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment