0
請告訴我,如果下面的方法是可靠的檢查,如果當前的日期範圍之間是這樣可靠checkl如果當前日期是在一個範圍內PHP
function check_in_range($start_date, $end_date)
{
// Convert to timestamp
$start_ts = strtotime($start_date);
$end_ts = strtotime($end_date)+86400;
//added 86400 to check for that particular date too
$timeNow = strtotime("now");
// Check that user date is between start & end
return (($timeNow >= $start_ts) && ($timeNow <= $end_ts));
}