Created
June 5, 2020 10:35
-
-
Save Farmatique/17172e04c88b862daf944df77ab7757b to your computer and use it in GitHub Desktop.
PHP custom array order
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
$skill = ["Advanced", "Essentials", "Intermediate"]; | |
$custom_order = [3, 1, 2]; | |
array_multisort($custom_order, $skill); | |
// after that: $skill becomes ["Essentials", "Intermediate", "Advanced"] |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment