title: Date Calculation in PHP
body: <p>I need to create a code in c# to check either the date picked is tomorrow onwards or has passed by today.</p>
  <p>My idea is $checkDateInPass will get the current date minus with 1 day. Thus when a user enter a date either it was on THAT date or afterwards, $checkPass will fly a green flag to say that it passed the first validation. If it was otherwise, it will turned into an error.</p>
  <p>Here's the code for date validation:</p>
  <pre><code>$checkDateInPass = date('d/m/Y',strtotime(&quot;-1 days&quot;));
  if($checkInDate &gt; $checkDateInPass)
  {
      $checkPass += 1;
  }
  else
  {
      $message = &quot;Please pick a proper date to check in.&quot;;
      echo &quot;&lt;script type='text/javascript'&gt;alert('$message');&lt;/script&gt;&quot;;
  }
  </code></pre>
  <p>Based on the above written code it work just fine IF I picked the check in date in the same month, but if I picked the check in date on the next month other than the current month, it doesn't work as expected.</p>
  <p>Here's an example, lets say that $checkDateInPass is 27/12/2016:</p>
  <p>A: I picked 29/12/2016 for first date, and 04/01/2017 for second date. It worked just fine.</p>
  <p>B: I picked 04/01/2017 for first date, and 07/01/2017 for second date. It turns out to be wrong.</p>
  <p>Is there any other IF statement to be considered for this statement?</p>