title: PHP check if date is between first and last day of current month
body: <p>Checking a $datetest array to find out if set dates are between the first and last day of current month. Output is wrong. dates, such as, '11-08-2014', '11-8-2014', are right and wrong in the output.</p>
  
  <pre><code>//get First day of Month
  //get Last day of Month
  
  $first_day_of_month = date('m-01-Y');
  
  $last_day_of_month = date('m-t-Y');
  
  echo "First Day of Month: ";
  echo $first_day_of_month;
  
  echo "&lt;br /&gt;";
  
  echo "Last Day of Month: ";
  echo $last_day_of_month;
  
  $datetest = array('11-30-2014', '11-31-2014', '11-08-2014', '11-8-2014', '11-9-2014', '11-11-2014', '11-24-2014', '11-1-2014', '10-30-2014', '12-1-2014', '11-1-1997');
  
  echo "&lt;br /&gt;&lt;br /&gt;";
  
  foreach ($datetest as $datetest) {  
  if (($datetest &gt;= $first_day_of_month) &amp;&amp; ($datetest &lt;= $last_day_of_month)){
  
      echo "$datetest :";
      echo " Is in Month!";
      echo "&lt;br /&gt;";
  
  } else {
      echo "$datetest :";
      echo "Not in Month!";
      echo "&lt;br /&gt;";
  }
  }
  </code></pre>
  
  <p>Outputs:
  First Day of Month: 11-01-2014
  Last Day of Month: 11-30-2014</p>
  
  <p>11-30-2014 : Is in Month!</p>
  
  <p>11-31-2014 :Not in Month!</p>
  
  <p>11-08-2014 : Is in Month!</p>
  
  <p>11-8-2014 :Not in Month!    X</p>
  
  <p>11-9-2014 :Not in Month!    X</p>
  
  <p>11-11-2014 : Is in Month!</p>
  
  <p>11-24-2014 : Is in Month!</p>
  
  <p>11-1-2014 : Is in Month!</p>
  
  <p>10-30-2014 :Not in Month!</p>
  
  <p>12-1-2014 :Not in Month!</p>
  
  <p>11-1-1997 : Is in Month!    X</p>