fork download
  1. <?php
  2.  
  3.  
  4. $items = [
  5. ['usu_codigo' => 1, /** resto do array **/],
  6. ['usu_codigo' => 2, /** resto do array **/],
  7. ['usu_codigo' => 3, /** resto do array **/],
  8. ];
  9.  
  10.  
  11.  
  12. usort($items, function ($a, $b) {
  13.  
  14. return $b['usu_codigo'] - $a['usu_codigo'];
  15. });
  16.  
  17.  
  18.  
  19. print_r($items);
Success #stdin #stdout 0s 82560KB
stdin
Standard input is empty
stdout
Array
(
    [0] => Array
        (
            [usu_codigo] => 3
        )

    [1] => Array
        (
            [usu_codigo] => 2
        )

    [2] => Array
        (
            [usu_codigo] => 1
        )

)