Timed File with PHP

Do you have a question? Post it now! No Registration Necessary.  Now with pictures!

Threaded View

Greetings all... I was told this would be easy with PHP, but I don't
know enough about PHP, so I thought I'd ask here...

I want the main page of my domain to have certain content up until a
certain date, then different content on a different date. I will be out
of town and was hoping this could be done automatically. Someone told
me this would be easy with PHP using the "if else" statements, a
switch, and using the date() functions.

Can anyone help if this is easy, or let me know if this isn't?


Re: Timed File with PHP

rehs...@yahoo.com wrote:
Quoted text here. Click to load it

Easy indeed:

$certain_date = 'May 15, 2005';
$certain_time = strtotime($certain_date);
if (time() > $certain_time) {
  echo 'New Content';
} else {
  echo 'Old Content';


Re: Timed File with PHP

Wow, that's really simple.

Nevertheless, THANK YOU for supplying it!!!

Site Timeline