Can anyone correct the error in my script to calculate the number of days between 2 dates. The dates have been input through a form, the variable info is as followed:
Here's an easy way:
$depart = strtotime(implode(' ', $_POST['departon'])); $return = strtotime(implode(' ', $_POST['returnon'])); $diff = floor(($return - $depart) / (60 * 60 * 24));
Note: there's only 30 days in June.