

<?php



$titi = checkdate(12, 30, 2000);



echo $titi;





$lulu = checkdate(2, 29, 2001);





echo $lulu;







var_dump(checkdate(12, 31, 2000));

var_dump(checkdate(2, 29, 2001));



echo checkDateTime("3-09-2015");



echo checkDateTime("32-09-2015");



echo checkDateTime("07-09-2015");





 $jour = "01"; 

 $mois = "04";

 $annee = "2015"; 

 $date_format = $jour ."-" .$mois ."-" .$annee; 

echo checkDateTime($date_format);

 

 

function checkDateTime($data) {

    if (date('d-m-Y', strtotime($data)) == $data) {

        return "OK";

    } else {

        return "erreur";

    }

}



?>

