How do I set time shedule for a post with php

Hi,

I’m seeking recommendation of keywords to search for a method that I can set my message to show up e.g. 08:00:00 tomorrow.

I’ve no idea what does this thing call and my searching on google for several days yield nothing close to what I’m trying to achieve.

I’m using a .aspx website with a feature like this, but I want to know if I can do it with php.

Thanks
Ket

If I understand you correctly you want a message to display at a certain time?

A simple if condition would do it, just compare the current time() with the time to show the message.

@the182guy

Thanks, that’s interesting.

Can you give me a hint?

Ket

A quick example, but probably not what you’re looking for as this will only be triggered for 1 second. :wink:


<?php
$triggerTime = strtotime('tomorrow 14:00');

if(time() === $triggerTime){
  #show/do stuff
}

More likely, you’ll be looking for something like…


<?php
$triggerTime = strtotime('tomorrow 14:00');

/* "at" trigger time */
if(time() === $triggerTime){
  #show/do stuff
}

/* "after" trigger time */
if(time() > $triggerTime){
  #show/do stuff
}

/* "before" trigger time */
if(time() < $triggerTime){
  #show/do stuff
}

Thanks AnthonySterling,

I’m testing the codes.

Ket