title: PHP date, how to prevent php date for auto convert to next day?
body: <p>As you may know, php date will return a valid date on these dates:</p>
  
  <pre><code>year-04-31
  
  year-06-31
  
  year-09-31
  </code></pre>
  
  <p>I have read other <a href="https://stackoverflow.com/questions/44362850/strtotime-on-incorrect-dates">SO thread here</a> 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 <code>2018-04-31</code>, the system will prompt an error.</p>
  
  <pre><code>$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';
  </code></pre>
  
  <p><strong>EDIT</strong></p>
  
  <p>someone actually posted this question as duplicate for <a href="https://stackoverflow.com/questions/19271381/correctly-determine-if-date-string-is-a-valid-date-in-that-format">for this thread in SO</a>...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</p>