note 83946 added to function.date

From: Date: Thu, 19 Jun 2008 21:16:17 +0000
Subject: note 83946 added to function.date
Groups: php.notes 
Request: Send a blank email to php-notes+get-140599@lists.php.net to get a copy of this message
Hi, I am so freaking new to PHP... I want to create a code in which I state the date. And based on that date I can show a CODEWORD, or image on future dates. So, let's say the date is 06-19-2008, now... if its +1 day it will echo this if its +2 days it will echo this if its +3 days it will echo this...... and so on. This is what I came up with, but can't seem to make it work... $startdate = '06/19/2007'; if ($newdate == date('m/d/Y', strtotime("+1 days", strtotime($startdate)))) echo "first<br>"; if ($newdate == date('m/d/Y', strtotime("+2 days", strtotime($startdate)))) echo "second<br>"; if ($newdate == date('m/d/Y', strtotime("+3 days", strtotime($startdate)))) echo "third<br>"; it doesn't work... it just writes all the dates... -=( I need this to show one code per day from a starting date. Thanks P.S. in the past, I did this: but it sux because I have to change the dates all the time I need a new one. $today = date("m-d-Y"); if ($today == date("05-16-2008")) { $video1 = 343KOSLL31';} if ($today == date("05-17-2008")) { $video1 = '5MK78hZL3o0';} if ($today == date("05-18-2008")) { $video1 = '5xNZ5CC0gvk';} if ($today == date("05-19-2008")) { $video1 = '3q2vZDQU8aA';} if ($today == date("05-20-2008")) { $video1 = 'BfWIP02g41g';} if ($today == date("05-21-2008")) { $video1 = 'lawXkvPFRgI';} HEEEEEEEEEEEELP... anyone??? ---- Server IP: 64.71.164.2 Probable Submitter: 207.230.140.242 ---- Manual Page -- http://www.php.net/manual/en/function.date.php Edit -- https://master.php.net/note/edit/83946 Del: integrated -- https://master.php.net/note/delete/83946/integrated Del: useless -- https://master.php.net/note/delete/83946/useless Del: bad code -- https://master.php.net/note/delete/83946/bad+code Del: spam -- https://master.php.net/note/delete/83946/spam Del: non-english -- https://master.php.net/note/delete/83946/non-english Del: in docs -- https://master.php.net/note/delete/83946/in+docs Del: other reasons-- https://master.php.net/note/delete/83946 Reject -- https://master.php.net/note/reject/83946 Search -- https://master.php.net/manage/user-notes.php

« previous php.notes (#140599) next »