📜  php 比较两个日期 - PHP 代码示例

📅  最后修改于: 2022-03-11 14:54:27.900000             🧑  作者: Mango

代码示例6
$date1 = "2021-01-15";
$date2 = "2021-01-18";

if ($date1 < $date2) {
     echo "$date1 is earlier than $date2";
} else {
    echo "$date1 is later than $date2";
}