title: Reverse an associative array with preserving keys in PHP
body: <p>I spent half an hour but I haven't found a solution.</p>
  
  <p>Following example of an array:</p>
  
  <pre><code>array(14) {
    ["label_text"]=&gt; string(10) "Label text"
    ["e-mail"]=&gt; string(6) "E-Mail"
    ["company"]=&gt; string(7) "Company"
    ["last_name"]=&gt; string(9) "Last name"
    ["first_name"]=&gt; string(10) "First name"
  }
  </code></pre>
  
  <p>What I want to do is just reverse the elements, so that the result is this:</p>
  
  <pre><code>array(14) {
    ["first_name"]=&gt; string(10) "First name"
    ["last_name"]=&gt; string(9) "Last name"
    ["company"]=&gt; string(7) "Company"
    ["e-mail"]=&gt; string(6) "E-Mail"
    ["label_text"]=&gt; string(10) "Label text"
  }
  </code></pre>
  
  <p>There must be a native php for this, but I think I'm blind. I just don't know which function to use.</p>
  
  <p>Any help appreciated!</p>