Created
June 14, 2019 11:10
-
-
Save Artisan-Asad/eb1e1d3046dc2488edf4c4e43806c729 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public static function sort_array( $array ) { | |
usort($array, array( 'self', 'sort_fallback' ) ); | |
return $array; | |
} | |
private static function sort_fallback( $a, $b ) { | |
return $b[1] - $a[1]; | |
} | |
$sorted_array = Some_Class::sort_array( $array ); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment