Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save Hexodus/eb790e68386434136e2faccda9d44a36 to your computer and use it in GitHub Desktop.
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.
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