An other solution (with the assumption you know your date formats are always YYYY/MM/DD with lead zeros) is the max() and min() function. I figure this is okay given all the other answers assume the yyyy-mm-dd format too and it's the common naming convention for folders in file systems if ever you wanted to make sure they sorted in date order.
As others have said, given the order of the numbers you can compare the strings, no need for strtotime() function.
Examples:
$biggest = max("2018/10/01","2018/10/02");
The advantage being you can stick more dates in there instead of just comparing two.
$biggest = max("2018/04/10","2019/12/02","2016/03/20");
To work out if a date is in between two dates you could compare
the result of min() and max()
$startDate="2018/04/10";
$endDate="2018/07/24";
$check="2018/05/03";
if(max($startDate,$check)==min($endDate,$check)){
// It's in the middle
}
It wouldn't work with any other date format, but for that one it does. No need to convert to seconds and no need for date functions.