title: Array case-insensitive key sort in PHP version 5.3 or less
body: <p>PHP 5.4 introduces the useful SORT_FLAG_CASE for making any other search case insensitive. Unfortunately this isn't available in PHP 5.3 or less and so I was wondering how the following array:</p>
  
  <pre><code>array('a'=&gt;2,'b'=&gt;4,'A'=&gt;1,'B'=&gt;3);
  </code></pre>
  
  <p>Could be sorted into:</p>
  
  <pre><code>array('A'=&gt;1,'a'=&gt;2,'B'=&gt;3,'b'=&gt;4);
  </code></pre>
  
  <p>As the usual <code>ksort()</code> function sorts it as:</p>
  
  <pre><code>array('A'=&gt;1,'B'=&gt;3,'a'=&gt;2,'b'=&gt;4);
  </code></pre>