Created
March 30, 2016 18:59
-
-
Save Hexodus/eb790e68386434136e2faccda9d44a36 to your computer and use it in GitHub Desktop.
This sorts a multidimensional associative array and keeps the values. Please note that uasort() and usort() are sorting an array and not returning a new one.
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
uasort($array_to_sort, function($a, $b) | |
{ | |
return $a['order'] - $b['order']; | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment