<?php $currentDate= date('Y-m-d'); $yesterday = strtotime ( '-1 day', strtotime ($currentDate)); $inputDate = '2012-05-28'; //25 mei 2012 $inputDate = strtotime($inputDate); if($inputDate > $yesterday){ echo 'Invalid date!'; }else{ //lakukan sesuatu }
$yesterday = strtotime ( '-1 day', strtotime ($currentDate));
$yesterday = strtotime ( '-0 day', strtotime ($currentDate));