Sort array by two specifics values in PHP [SOLVED!]
<p>The folks have already showed me how to sort an array by a specific value using usort and a fallback function in PHP. </p>

<p>What if this specifc value doesn't exist and we have to use two values? in the example bellow the values [4] and [5]... In other words, I want to do this: order all objects numericaly by the fith value of each object <strong>from the highest to the lowest</strong>, and addicionally, for those objects that have the fifht value is empty (in the examplem '-'), order them by the fourth value.</p>

<pre><code>Array(

 [0] =&gt; Array(
  [0] =&gt; links-patrocinados
  [1] =&gt; adwords
  [2] =&gt; 0,5
  [3] =&gt; R$92,34
  [4] =&gt; 823000
  [5] =&gt; 49500
 )
 [1] =&gt; Array(
  [0] =&gt; adwords
  [1] =&gt; google adwords como funciona
  [2] =&gt; 0,38
  [3] =&gt; R$0,20
  [4] =&gt; 480
  [5] =&gt; 480
 )
 [2] =&gt; Array(
  [0] =&gt; links-patrocinados
  [1] =&gt; adword
  [2] =&gt; 0,39
  [3] =&gt; R$58,77
  [4] =&gt; 49500
  [5] =&gt; 2900
 )
 [3] =&gt; Array(
     [0] =&gt; agencia
     [1] =&gt; agencias viagens espanholas
     [2] =&gt; -
     [3] =&gt; R$0,20
     [4] =&gt; 58
     [5] =&gt; -
 )
 [4] =&gt; Array(
     [0] =&gt; agencia
     [1] =&gt; era agencia imobiliaria
     [2] =&gt; -
     [3] =&gt; R$0,20
     [4] =&gt; 73
     [5] =&gt; -
 )

)
</code></pre>
