title: PHP if statement compare 3 dates
body: <p>I am having trouble writing if statement</p>
  
  <p>there are the 3 variables</p>
  
  <pre><code>$date = 1985-11-01;
  
  $date2 = 2005-11-08;
  
  $date3 = 2006-11-08;
  </code></pre>
  
  <p>and here is my if statement.</p>
  
  <pre><code>if($date &gt; $date2 &amp;&amp; $date &lt; $date3) {
              // dob is between the limits
              return TRUE;
          }
          else {
              // dob is outside the limits
              return FALSE;
          }
  </code></pre>
  
  <p>What I am try to do is, if $date is not in between $date2 and $date3, return false. I am very tired today and my brain is not working, can someone tell me what I am doing wrong?</p>