-2

The question is how is it possible to get difference in days from before to today and knowing this difference is happened in the past?

Mahdi Rashidi
  • 411
  • 3
  • 8

1 Answers1

1

Yes its possible to get difference in days from before to today, all you need is the dates. for the example this is some check in and check out date diff.

// Params in date
public static function getDateDifference($check_in, $check_out)
    {
        $check_in = strtotime($check_in);
        $check_out = strtotime($check_out);
        $date_difference = $check_out - $check_in;
        $date_difference = round($date_difference / (60 * 60 * 24));
        return $date_difference;
    }
Wailan Tirajoh
  • 481
  • 5
  • 17