title: PHP Checking if the date is today or up to 7 days in future
body: <p>I am trying to solve a supposedly basic problem. I want to check that if the user has entered valid date. Valid date in our application is that of today or up to next 7 days. So any date within that range is valid. Any date in past or from 7th day upward from now will be considered as invalid.</p>
  
  <p>I have written a small function to solve this:</p>
  
  <pre><code>function is_valid($d)
  {
  if( strtotime($d) &lt; strtotime('+7 days') ) {
  return true;
  }
  else return false;
  }
  Usage : is_valid('01-20-2015');  //M-D-Y
  </code></pre>
  
  <p>But this is always returning true.</p>
  
  <p>What am I doing wrong?</p>
  
  <p>Ahmar</p>