PHP Date Switch


/ Published in: PHP
Save to your folder(s)



Copy this code and paste it in your HTML
  1. //Show content based on the day
  2. if ($ts > mktime(0,0,0,5,7,2010)) {
  3. //5/7/2010
  4. echo "It's May 5th or later!";
  5. } else if ($ts > mktime(0,0,0,4,26,2010)) {
  6. //4/26/2010
  7. echo "It's between April 26 and May 5!";
  8. } else {
  9. echo "It's earlier than 4/26!";
  10. }

Report this snippet


Comments

RSS Icon Subscribe to comments

You need to login to post a comment.