Skip to content

Instantly share code, notes, and snippets.

@evgv
Last active October 12, 2018 11:53
Show Gist options
  • Save evgv/57d6dc82550904b5ec561974ae3ed3fb to your computer and use it in GitHub Desktop.
Save evgv/57d6dc82550904b5ec561974ae3ed3fb to your computer and use it in GitHub Desktop.
PHP. Sort associated array by value use anonymous function.

Sort associated array by value use anonymous function, sort by order field

  usort($data, 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