-4

给出日期含义的代码不能超过当前日期?

<?php
else if($cust_dob  date("d-m-y")){
echo "Error : Your date of birth cannot be in future.";
}

?>
4

1 回答 1

0

尝试以下代码:

$cust_dob = "2013-09-03";

if(strtotime($cust_dob) > time())
    echo "Error : Your date of birth cannot be in future.";
于 2013-09-02T06:52:06.163 回答