Hello, I am using this function below to validate date, when the user enter a valid date format every is fine and it apears on my DB, but when the user enter any thing like abcde or 22107666, i expect it to give an error message as shown on the code, but instead it gives a warning.
Warning: extract() expects parameter 1 to be array, null given in C:

please could someone help

 function Valid_Date_Format($date)
  {
    $converted=str_replace('/','-',$date);

    if(preg_match("/^((((19|20)(([02468][048])|([13579][26]))-02-29))|((20[0-9][0-9])|(19[0-9][0-9]))-((((0[1-9])|
(1[0-2]))-((0[1-9])|(1\d)|(2[0-8])))|((((0[13578])|(1[02]))-31)|(((0[1,3-9])|
(1[0-2]))-(29|30)))))$/",$converted)===1)
    {
      return TRUE;
    }

    return FALSE; 
    $errors[] = "$value is not a valid date of birth.";  
  }
Member Avatar for diafol

where's your extract() line?

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.