title: php usort on different values
body: <p>I am using  this usort function to sort the array by value:</p>
  
  <pre><code>    function cmp($a, $b)
      {
          if ($a["value"] == $b["value"])
          { return 0; }
          return ($a["value"] &lt; $b["value"]) ? -1 : 1;
      }
  </code></pre>
  
  <p>Now, each object also has an "active" field as well, that is: $a["active"]. I would like to have the sorted array to have first the active ones (1) ordered by value, then, when all of them are sorted, the inactive (0) ones. I tried using another usort after this but it doesn't work nicely, it somewhat scrambles them.</p>
  
  <p>Thanks in advance.</p>