strtotime assume European formatted dates if they are seperated by - and USA date format if they are seperated by /
Note: from the manual strtotime()
Dates in the m/d/y or d-m-y formats are disambiguated by looking at the separator between the various components: if the separator is a slash (/), then the American m/d/y is assumed; whereas if the separator is a dash (-) or a dot (.), then the European d-m-y format is assumed. If, however, the year is given in a two digit format and the separator is a dash (-, the date string is parsed as y-m-d.
To avoid potential ambiguity, it's best to use ISO 8601 (YYYY-MM-DD) dates or DateTime::createFromFormat() when possible.
So you can just str_replace the - for /
// m-d-Y (Month-Day-Year)
$test_date = '05-10-2016';
$test_date = str_replace('-', '/', $test_date);
// Convert to Y-m-d
$convert_date = date('Y-m-d', strtotime($test_date));
echo $convert_date;
Or better still use the DateTime object
-to separate the components, so strtotime decides it's dd-mm-yyyy. if you'd used/, then it'd be treated asmm/dd/yyyy. Do NOT use strtotime to parse ambiguous inputs. in fact, if you KNOW the format of the date string in advance, don't even bother trying to use strtotime. usedate_create_from_format()and get a 100% reliable parsing.