title: How to sort a multi-dimensional array by a 4th level value in PHP
body: <p>I have an array which is converted from an XML response. What I need to do is sort the array ascending alphabetically using the 'COMPANY' value.</p>
  
  <p>I have attempted to use array_multisort, but I'm having no luck at all. Any help would be greatly appreciated.</p>
  
  <p>Here is the array:</p>
  
  <pre><code>array(1) {
    ["DATASOURCE"]=&gt;
    array(1) {
      ["MEMBER"]=&gt;
      array(4) {
        [0]=&gt;
        array(4) {
          ["REFNO"]=&gt;
          string(6) "000762"
          ["STATUS"]=&gt;
          string(5) "CURRE"
          ["DATE"]=&gt;
          string(8) "20100731"
          ["COMPANY"]=&gt;
          string(80) "Tresham Institute Business Solutions                                            "
        }
        [1]=&gt;
        array(4) {
          ["REFNO"]=&gt;
          string(6) "003721"
          ["STATUS"]=&gt;
          string(5) "CURRE"
          ["DATE"]=&gt;
          string(8) "20100930"
          ["COMPANY"]=&gt;
          string(80) "Triad esign                                                                    "
        }
        [2]=&gt;
        array(4) {
          ["REFNO"]=&gt;
          string(6) "011412"
          ["STATUS"]=&gt;
          string(5) "CURRE"
          ["DATE"]=&gt;
          string(8) "20100630"
          ["COMPANY"]=&gt;
          string(80) "Transpower Drives Ltd                                                           "
        }
        [3]=&gt;
        array(4) {
          ["REFNO"]=&gt;
          string(6) "059647"
          ["STATUS"]=&gt;
          string(5) "CURRE"
          ["DATE"]=&gt;
          string(8) "20100630"
          ["COMPANY"]=&gt;
          string(80) "Trek-Kits Ltd                                                                   "
        }
      }
    }
  }
  </code></pre>