SHARE
TWEET

Date Dependent Stylesheets

fidle89 Feb 7th, 2019 12 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. <?php
  2. $dateShort = date('md');
  3.  
  4. if ($dateShort >= "0101" && $dateShort <= "0131") {
  5.     $cssTheme = "newyear";
  6. } elseif ($dateShort >= "1020" && $dateShort <= "1031") {
  7.     $cssTheme = "halloween";
  8. } elseif ($dateShort >= "1212" && $dateShort <= "1231") {
  9.     $cssTheme = "christmas";
  10. } else {
  11.     $cssTheme = "default";
  12. }
  13. ?>
  14.  
  15. <link type="text/css" rel="stylesheet" href="css/<?= $cssTheme ?>.css">
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top