title: How to convert Y-m-d H:i:s to Y-m-d in PHP?
body: <p>How to convert Y-m-d H:i:s to Y-m-d in PHP?</p>
  
  <p>I have e.g. </p>
  
  <pre><code>$date = "2011-08-10 20:40:12";
  </code></pre>
  
  <p>and would like to convert it to just</p>
  
  <pre><code>$output = "2011-08-10";
  </code></pre>
  
  <p>Thanks in advance.</p>