Hey i hope it ain't toooo late to answer this; however it should help people who will view this question in the future
Just use this function:
function mysqlDate($input) {
$output = false;
$d = preg_split('#[-/:. ]#', $input);
if (is_array($d) && count($d) == 3) {
if (checkdate($d[1], $d[0], $d[2])) {
$output = "$d[2]-$d[1]-$d[0]";
}
}
return $output;
}
Lets say that you have a date input as $_POST['date'], the function usage is going to be as in below:
$newDate = mysqlDate($_POST['date']);
Just store the $newDate in your database. Works like magic.
strptime("250711", "%d%m%y")