Skip to content

Instantly share code, notes, and snippets.

@KorvinM
Last active June 4, 2020 12:34
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 KorvinM/f17310528e8b26f04a0a6d2042f89217 to your computer and use it in GitHub Desktop.
Save KorvinM/f17310528e8b26f04a0a6d2042f89217 to your computer and use it in GitHub Desktop.
PHP to output a daily god.
<?php
$today = getdate();
$dayOfWeek = $today['weekday'];
$godsOfDay = [
'Monday' => 'mani',
'Tuesday' => 'tyr',
'Wednesday' => 'odin',
'Thursday' => 'thor',
'Friday' => 'frigg',
'Saturday' => 'saturn',
'Sunday' => 'sol'
];
if (in_array($dayOfWeek, array_keys($godsOfDay))){
$god = $godsOfDay[$dayOfWeek];
echo 'Today\'s deity: <span style="text-transform:capitalize;">' . $god. '</span>';
}
?>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment