title: php - Sort array with date as key
body: <p>Hi I have an array with keys as date in this format.</p>
  
  <pre><code>$arr = array(
  
      "20110805" =&gt; "2",
      "20100703" =&gt; "5",
      "20110413" =&gt; "3",
      "20100805" =&gt; "4",
      "20100728" =&gt; "6",
      "20090416" =&gt; "7",
      "20080424" =&gt; "8",
      "20110819" =&gt; "1",  
  );
  </code></pre>
  
  <p>how can I sort this array by key. Thank you.</p>