I was trying to define a function to validate date entered in dd/mm/yyyy format.
I am trying to use the inbuilt function checkdate() and explode() to supply values to checkdate()
This is the code:
<?php
function validate_date($date){
$array = explode('/',$date,3);
checkdate($array[1],$array[0],$array[2]);
}
?>
I get an error:
Warning: checkdate() expects exactly 3 parameters, 1 given in C:\xampp\htdocs\officespace\mdm\Create_Individual.php on line 57
Please can someone indicate where exactly I’m going wrong.
Thanks.
bool checkdate ( int $month , int $day , int $year )
http://codepad.org/hKZP726r
Output: