Created
January 9, 2022 12:25
-
-
Save Kovah/c7e4584c9bd45ff30d5ca344dd37a6bc to your computer and use it in GitHub Desktop.
PHP Tip natsort()
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
<?php | |
// @see https://www.php.net/manual/en/function.natsort.php | |
$numbers = [26, 6, 2, 65]; | |
sort($numbers); | |
// 2, 26, 6, 65 | |
natsort($numbers); | |
// 2, 6, 26, 65 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment