Thursday, 23 July 2015

How date regular expression in php validation

if(!preg_match('/^(19|20)\d\d[\-\/.](0[1-9]|1[012])[\-\/.](0[1-9]|[12][0-9]|3[01])$/',$txtstrtdate))
       {
           echo $error="In valid Date";
          $code="2";
       }

No comments:

Post a Comment