title: redefine array keys php
body: <p>I have an array.</p>
  
  <pre><code>Array
  (
      [0] =&gt; Array
          (
              [TotalClicksPerDay] =&gt; 5
              [Date] =&gt; 2012-11-26
              [weekDay] =&gt; 2
          )
  
      [1] =&gt; Array
          (
              [TotalClicksPerDay] =&gt; 13
              [Date] =&gt; 2012-11-27
              [weekDay] =&gt; 6
          )
  
  )
  </code></pre>
  
  <p>I want to redefine the keys by using the value [weekday] as the key.</p>
  
  <p>So in the example above, the new array would read like so:</p>
  
  <pre><code>Array
  (
      [2] =&gt; Array
          (
              [TotalClicksPerDay] =&gt; 5
              [Date] =&gt; 2012-11-26
              [weekDay] =&gt; 2
          )
  
      [6] =&gt; Array
          (
              [TotalClicksPerDay] =&gt; 13
              [Date] =&gt; 2012-11-27
              [weekDay] =&gt; 6
          )
  )
  </code></pre>