Can someone give me a working example of what my code should be as my efforts are getting me nowhere?
My code currently says have
if (isset($_POST['startdate'])) {
$startdate = DatePickerToTime($_POST['startdate']);
} else {
$startdate = strtotime('today midnight');
}
and
if (isset($_POST['enddate'])) {
$enddate = DatePickerToTime($_POST['enddate']);
} else {
$enddate = time();
}
which works.
However, I want to say if startdate
is equal to enddate
then add 23 hours and 59 minutes to enddate
I have read the documentation and am trying
if($_POST['$startdate'] == $_POST['$enddate']) {
$_POST['$enddate'] += date("h:i:sa", "23:59:59");
}
but this doesn't work.