Skip to content

Instantly share code, notes, and snippets.

@oriolrivera
Created September 9, 2015 23:33
Show Gist options
  • Save oriolrivera/e663f94d5d3d62dab5d6 to your computer and use it in GitHub Desktop.
Save oriolrivera/e663f94d5d3d62dab5d6 to your computer and use it in GitHub Desktop.
detectando numero multiplo de 3,5
<?php
for ($i=1; $i < 200; $i++) {
if (fmod($i,5)) {
echo $i."<br>";
}else{ if (!fmod($i,5)) {
echo "red<br>";
}
}
if (!fmod($i,3)) {
echo "blue<br>";
}
if (!fmod($i,3) and !fmod($i,5)) {
echo "RedBlue<br>";
}
}#end for
?>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment