I am new to PHP and trying to convert a date from a registration form (in the form 01/01/2011) to Y-m-d so that it can be stored in the database.
This is the code I have, pretty sure it worked before but now it has stopped working. Any ideas?
$dateformat = $_POST['dob'];
$correctformat = date('Y-m-d',strtortime($dateformat));
I have checked what $_POST['dob'] is printing and it is correct, however the $correctformat is printing 1970-01-01 everytime.
Any help would be greatly appreciated.
Thanks
1 Answer