Skip to content

Instantly share code, notes, and snippets.

@ReinierC
Last active January 5, 2018 16:02
Show Gist options
  • Save ReinierC/73e1d1d0f08b39f08da417e984d279a2 to your computer and use it in GitHub Desktop.
Save ReinierC/73e1d1d0f08b39f08da417e984d279a2 to your computer and use it in GitHub Desktop.
Woof-Meow / Copper-Lunch-Brake

RC Logo

An adaptation of Fizz-Buzz

<!doctype html>
<html>
<head>
<meta charset="utf-8">
<title>Copper Lunch Break</title>
<style>
p {
font-size: 12px;
}
.alert {
color: red;
}
</style>
</head>
<body>
<h2>BussFizz WoofMeow CopperLunchBreak</h2>
<?php
function copperLunchbreak(){
for ($i = 1; $i <= 100; $i++){
if($i % 3 == 0 && $i % 5 ==0){
echo "<a class='alert'>$i Attention all officers</a></br>";
}
else if($i % 3 == 0){
echo $i." Pizza for lunch<br />";
}
else if($i % 5 == 0){
echo $i." Donuts for lunch<br />";
}
else {
echo $i." Sleeping on the job<br />";
}
}
}
?>
<div>
<p><?php copperLunchbreak() ?><p>
</div>
</body>
</html>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment