Friday, October 3, 2014

การลบวันที่สองวันโดยใช้ PHP DateDiff (Date Difference By PHP)

<?
function DateDiff($strDate1,$strDate2)
{
return (strtotime($strDate2) - strtotime($strDate1))/ ( 60 * 60 * 24 ); // 1 day = 60*60*24
}

echo DateDiff("2014-10-01","2014-10-05");
?>


No comments:

Post a Comment