Skip to content

Instantly share code, notes, and snippets.

@impshum
Last active January 20, 2019 15:07
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 impshum/362bb5e527d374cfb776929276b0d8e3 to your computer and use it in GitHub Desktop.
Save impshum/362bb5e527d374cfb776929276b0d8e3 to your computer and use it in GitHub Desktop.
<?php
function go(){
$day = date('l');
if ($day == 'Monday') {
display($day, 'red');
} elseif ($day == 'Tuesday') {
display($day);
} elseif ($day == 'Wednesday') {
display($day);
} elseif ($day == 'Thursday') {
display($day);
} elseif ($day == 'Friday') {
display($day);
} elseif ($day == 'Saturday') {
display($day);
} elseif ($day == 'Sunday') {
display($day);
}
}
function display($day){
echo "<h1 class='$day'>Today is $day</h1>";
}
?>
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<title>Daze</title>
</head>
<style>
.Monday {
color: red;
}
.Tuesday {
color: green;
}
.Wednesday {
color: blue;
}
.Thursday {
color: pink;
}
.Friday {
color: orange;
}
.Saturday {
color: grey;
}
.Sunday {
color: purple;
}
</style>
<body>
<?php go(); ?>
</body>
</html>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment