title: How to get only the year part of a date string?
body: <p>I have an input date by user like this: <code>1979-06-13</code></p>
  
  <p>Now, i want to compare the year:</p>
  
  <pre><code>foreach ($list as $key) {
      $year = 1979;
      if ($key &gt; $year) { //only the year
          echo (error);
          }
  }
  </code></pre>
  
  <p>How can I get only the year?</p>
  
  <p>Thanks</p>