Hello i'm trying to make a php script that compares the date from one of my database records and todays date, if the difference in days is greater than 3, it will come out to true.
example:
$todays_date = date("Y-m-d"); <-- Todays date
$deal_date = $data["Deal Date"]; <-- Date from database
$interval = date_diff($todays_date, $deal_date); <--Difference
if($interval >= 3)
{
(something)
}
but every time i try this i get an error "date_diff() expects parameter 1 to be DateTime, string given" i know that to use date_diff both arguments have to be datetime, but i'm not sure how to get today's date in date and how to convert the date from the database into datetime.