fork download
  1. <?php
  2.  
  3. $arr = array(
  4. array('show_name' => 'foo', 'other_value' => 1),
  5. array('show_name' => 'bar', 'other_value' => 1)
  6. );
  7.  
  8.  
  9. usort($arr, function ($a, $b) { return $b['show_name'] < $a['show_name']; });
  10.  
  11. var_dump($arr); // bar is not ahead of foo.
Success #stdin #stdout 0.01s 20520KB
stdin
Standard input is empty
stdout
array(2) {
  [0]=>
  array(2) {
    ["show_name"]=>
    string(3) "bar"
    ["other_value"]=>
    int(1)
  }
  [1]=>
  array(2) {
    ["show_name"]=>
    string(3) "foo"
    ["other_value"]=>
    int(1)
  }
}