title: Compare Dates PHP
body: <p>I want to only shows result for the current month, but I have no idea how to do this, my current output is like this.</p>
  
  <p><strong>Output</strong></p>
  
  <pre><code>2014-04-11
  -&gt; array
  2014-04-11 
  2014-04-05
  2014-03-29
  </code></pre>
  
  <p><strong>PHP</strong></p>
  
  <pre><code>$date = date('Y-m-d');
  
  echo $date;
  
  echo "&lt;pre&gt;";
  foreach ($submissions as $test){
      if($date &gt;=  substr($test['thing']['created'], 0, 10)){
          echo substr($test['thing']['created'], 0, 10);
          echo "&lt;br&gt;";
      }
  }
  echo "&lt;/pre&gt;";
  </code></pre>
  
  <p>My current code wont work as its only checking if the whole number is greater or equal to, any ideas anyone?</p>