Sixem

PHP Different Image Depending On The Day

Aug 8th, 2013
124
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 0.79 KB | None | 0 0
  1. <?php
  2. $mon = "random/mon.gif";
  3. $tue = "random/tue.gif";
  4. $wed = "random/wed.gif";
  5. $thu = "random/thu.gif";
  6. $fri = "random/fri.gif";
  7. $sat = "random/sat.gif";
  8. $sun = "random/sat.gif";
  9. $t=date('d-m-Y');
  10. $curlday = date("D",strtotime($t));
  11. $sothisgifistheonetoday = '';
  12. switch (strtolower($curlday)) {
  13.     case 'mon';
  14.         $sothisgifistheonetoday = $mon;
  15.         break;
  16.     case 'tue':
  17.         $sothisgifistheonetoday = $tue;
  18.         break;
  19.     case 'wed':
  20.         $sothisgifistheonetoday = $wed;
  21.         break;
  22.     case 'thu';
  23.         $sothisgifistheonetoday = $thu;
  24.         break;
  25.     case 'fri':
  26.         $sothisgifistheonetoday = $fri;
  27.         break;
  28.     case 'sat':
  29.         $sothisgifistheonetoday = $sat;
  30.         break;
  31.     case 'sun':
  32.         $sothisgifistheonetoday = $sun;
  33.         break;
  34. }
  35. ?>
  36. <div align="center"><img src="<?php echo $sothisgifistheonetoday; ?>"</div>
Advertisement
Add Comment
Please, Sign In to add comment