<?php
function isValid($date){
$date_format = 'd F Y';
$input =$date; //say '11 February 2013';
$input = trim($input);
$time = strtotime($input);
$is_valid = date($date_format, $time) == $input;
return $is_valid ? 'yes' : 'no';
}
function isValid($date){
$date_format = 'd F Y';
$input =$date; //say '11 February 2013';
$input = trim($input);
$time = strtotime($input);
$is_valid = date($date_format, $time) == $input;
return $is_valid ? 'yes' : 'no';
}
Comments
Post a Comment