title: convert dd-mm-yyyy to yyyy-mm-dd in php
body: <p>I tried the following code to change the dateformat from dmy to ymd, but when using i got wrong dates.</p>
  
  <p>My code</p>
  
  <pre><code>$sdate11=date("Y-m-d", strtotime($_POST["txtstartdates"]) );
  $sdate111=date("Y-m-d", strtotime($_POST["txtenddates"]) );
  </code></pre>
  
  <p>dates inserted were</p>
  
  <pre><code>30-05-2013 and  31-05-2013
  </code></pre>
  
  <p>the date it returned was</p>
  
  <pre><code>2035-11-03 and 2036-11-02 
  </code></pre>
  
  <p>could you please help me to find what was the problem here and solve it</p>
  
  <p>Thank you.</p>