I am trying to validate Date format mm/dd/yyyy
with the below code:
**Date is 1st Feb, 2014
$is_valid_date = date('m/d/Y', strtotime('02/01/2014')) == 02/01/2014;
I've tried checking format d-m-Y
in above code, it was working fine:
$is_valid_date = date('d-m-Y', strtotime('01-02-2014')) == 01-02-2014;
if( ! $is_valid_date){
echo 'invalid date';
}
How to do 1 scenario without using any regular expression ??