我想比較給定日期是早於當前日期。 IF聲明'日期在未來'的結果。有人能告訴我爲什麼PHP在IF語句中給出了錯誤的結果嗎?PHP無法比較日期
這裏是我使用
$date='17/06/2013';
$currentDate = date("d/m/Y");
if(strtotime($date) < strtotime($currentDate)) {
echo 'date is in the past';
}
else{
echo 'date is in the future';
}