01.
<?php
02.
function
DateDiff(
$strDate1
,
$strDate2
)
03.
{
04.
return
(
strtotime
(
$strDate2
) -
strtotime
(
$strDate1
))/ ( 60 * 60 * 24 );
05.
}
06.
function
TimeDiff(
$strTime1
,
$strTime2
)
07.
{
08.
return
(
strtotime
(
$strTime2
) -
strtotime
(
$strTime1
))/ ( 60 * 60 );
09.
}
10.
function
DateTimeDiff(
$strDateTime1
,
$strDateTime2
)
11.
{
12.
return
(
strtotime
(
$strDateTime2
) -
strtotime
(
$strDateTime1
))/ ( 60 * 60 );
13.
}
14.
15.
echo
"Date Diff = "
.DateDiff(
"2023-10-18"
,
"2024-03-31"
).
"<br>"
;
16.
17.
$total_pen_day1
= DateDiff(
"2023-10-18"
,
"2024-03-31"
);
18.
19.
echo
$total_pen_day1
.
"<br>"
;
20.
21.
?>