Hi all,
I'm trying to do a function that will check the php date against what is in the database. If the current date (YYYY-MM-DD HH:MM:SS) is 24 hours after the stored database date, then it will continue, otherwise it won't do anything.. If that makes sense?
Here's how I'm trying to get it to work, but not 100% sure how:
$now = date("Y-m-d H:i:s");
foreach($results as $item) {
if ( /*item date is 24 hours or more earlier than $now*/ ) { /* this is what I'm not sure how to do */
//do something
} else {
//do nothing
};
};
If someone could help me get this working, I'd greatly appreciate it. I just don't know how to compare $item->date with $now and see if $item->date is 24 hours or more behind $now..