As you may know, php date will return a valid date on these dates:
year-04-31
year-06-31
year-09-31
I have read other SO thread here about the non existed date, but this thread did not solve my problem. My goal is to prevent php to automatically let these date convert to next day. For example, if user input date 2018-04-31
, the system will prompt an error.
$value = '2018-06-31'; // assume user input this date
if(date is 04-31, 06-31 or 09-31) // i have no idea what to put here
echo 'wrong date, please enter again';
EDIT
someone actually posted this question as duplicate for for this thread in SO...which part it says something about 4-31, 6-31, 9-31? please dont simply mark this as duplicate, make your comparison between my question and the others before mark. thank you