Skip to content

Instantly share code, notes, and snippets.

@phpfiddle
Created May 5, 2020 07:03
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save phpfiddle/4701e1b2427c93c29c98ee2f26d1dba9 to your computer and use it in GitHub Desktop.
Save phpfiddle/4701e1b2427c93c29c98ee2f26d1dba9 to your computer and use it in GitHub Desktop.
[ Posted by Lanang ] thread_solution
<?php
for($num=1; $num <= 100; $num++) {
if($num % 3 == 0 && $num % 5 == 0) {
echo "yeah nah <br>";
}elseif($num % 3 == 0) {
echo "yeah <br>";
} elseif($num % 5 == 0) {
echo "nah <br>";
}else {
echo "$num <br>";
}
}
?>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment