how to convert mm/dd/yyyy to yyyy-mm-dd in php code example Example: php date format dd/mm/yyyy date("d/m/Y", strtotime($str));