How to compare two dates in php if dates are in format \'03_01_12\' and \'31_12_11\' .
\'03_01_12\'
\'31_12_11\'
I am using this code:
$date1=date(\'
Try this
$data1 = strtotime(\date("d/m/Y")); $data1 = date_create($data1); $data2 = date_create("21/06/2017"); if($data1 < $data2){ return "The most current date is date1"; } return "The most current date is date2";