Sort isoquery output by country name

This commit is contained in:
billz 2023-11-06 06:25:07 +00:00
parent 0751fc7ba4
commit 40dc86cc21

View file

@ -873,7 +873,7 @@ function getCountryCodes($locale = 'en', $flag = true) {
if ($flag) { if ($flag) {
$opt = '--flag'; $opt = '--flag';
} }
exec("isoquery $opt --locale $locale", $output); exec("isoquery $opt --locale $locale | awk -F'\t' '{print $5 \"\t\" $0}' | sort | cut -f2-", $output);
$countryData = []; $countryData = [];
foreach ($output as $line) { foreach ($output as $line) {