Jump to content

Archived

This topic is now archived and is closed to further replies.

runitzme

time in php4

Recommended Posts

hi i'm new to php and i'm trying to make a script that does certain things every 24 hours, anyone kno how i can do that?

Share this post


Link to post
Share on other sites
Heres the logic that i use for my page. Hope its useful.

[Quote]
$datetime = explode(" ",date("Y-m-d H:i:s"));
$date = explode("-",$datetime[0]);
$time = explode(":",$datetime[1]);
if((date("Y")-$date[0]>=1)||(date("m")-$date[1]>=1)||((date("j")-$date[2]>=1)&&(date("His")-implode($time)>=0)))
{
//write here what u want to do after 24hrs
}
[/Quote]

Share this post


Link to post
Share on other sites

×

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.