Obtain the string you want to convert into a date. This can be through a text box on an HTML form or it might be from a database table.
Store this string in a string variable using the assignment statement. For example, if using a form, $myDate = $_POST["txtDate"];
Define a variable to store the resulting date. Do this using the assignment operator and store a zero in the variable: $resultDate = 0;
Use the strtotime function to convert the string and store it in the date variable: $resultDate = strtotime($myDate);