If you have a $start_date
and $end_date
, how can you check if a date given by the user falls within that range?
e.g.
$start_date = '2009-06-17';
$end_date = '2009-09-05';
$date_from_user = '2009-08-28';
At the moment the dates are strings, would it help to convert them to timestamp integers?
Converting them to timestamps is the way to go alright, using strtotime, e.g.