3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php $arr = array( array( "Products" => array( "code" => "LD", "power" => "5", "channels" => "2" ) ), array( "Products" => array( "code" => "CAE", "power" => "15", "channels" => "1" ) ), array( "Products" => array( "code" => "FC", "power" => "12", "channels" => "1" ) ) ); function mySort($a, $b) { return strcasecmp($b["Products"]["code"], $a["Products"]["code"]); } usort($arr, "mySort"); print_r($arr);
based on bkY1v
Output for 4.3.0 - 7.3.0
Array ( [0] => Array ( [Products] => Array ( [code] => LD [power] => 5 [channels] => 2 ) ) [1] => Array ( [Products] => Array ( [code] => FC [power] => 12 [channels] => 1 ) ) [2] => Array ( [Products] => Array ( [code] => CAE [power] => 15 [channels] => 1 ) ) )