summaryrefslogtreecommitdiff
path: root/src/third_party/timelib-2018.03/zones/sort-index.php
diff options
context:
space:
mode:
Diffstat (limited to 'src/third_party/timelib-2018.03/zones/sort-index.php')
-rw-r--r--src/third_party/timelib-2018.03/zones/sort-index.php17
1 files changed, 17 insertions, 0 deletions
diff --git a/src/third_party/timelib-2018.03/zones/sort-index.php b/src/third_party/timelib-2018.03/zones/sort-index.php
new file mode 100644
index 00000000000..3982b453484
--- /dev/null
+++ b/src/third_party/timelib-2018.03/zones/sort-index.php
@@ -0,0 +1,17 @@
+<?php
+ $idx = file("timezonedb.idx");
+ usort($idx, 'sortfunc');
+ echo implode($idx);
+
+ function sortfunc($a, $b)
+ {
+ /* Grep tz names */
+ preg_match('@"([^"]+)"@', $a, $ma);
+ $na = $ma[1];
+ preg_match('@"([^"]+)"@', $b, $mb);
+ $nb = $mb[1];
+
+ $val = strcasecmp($na, $nb);
+ return $val;
+ }
+?>