The date expired and the active date depends on the current date. You should combine two dates to get the date expired and active in PHP. Create an expired and active condition using an if-else statement in PHP. You have to make a condition like -
if(end_date<current_date)
{
echo 'Date expired';
}
else
{
echo 'Date active';
}
In your case, you are missing the correct form of dates.
$today_date = date("Y-m-d");
$last_date = "2022-03-20";
Now, you will get expired when the last_date will be less than the current date and will get active when the last_date will be greater than the current date.