PHP 8.5.0 RC4 available for testing

Voting

: min(eight, six)?
(Example: nine)

The Note You're Voting On

Jesse K
5 years ago
'asort' is fine for sorting arrays in English, but if accented characters exist in the array then it is better to use the 'asort' method of PHP's Collator class:
https://www.php.net/manual/en/class.collator.php

$collator = new \Collator('fr_CA');
$collator->asort($french_list);

There are options for using `setlocale()` to control `asort` behaviour, but it isn't reliable across systems.
For instance, in my development environment I only have access to the following locals:

$ locale -a
C
C.UTF-8
POSIX

<< Back to user notes page

To Top