Mercurial > hg > batmud > maputils
diff www/loc.php @ 2278:3293678b598b
Use a custom comparision function for location sorting.
author | Matti Hamalainen <ccr@tnsp.org> |
---|---|
date | Thu, 02 Apr 2020 21:57:55 +0300 |
parents | 0556b65f137b |
children | 710debf83f53 |
line wrap: on
line diff
--- a/www/loc.php Sat Mar 28 23:25:40 2020 +0200 +++ b/www/loc.php Thu Apr 02 21:57:55 2020 +0300 @@ -59,6 +59,11 @@ } +function locCompare($va, $vb) +{ + return strcmp($va["name"], $vb["name"]); +} + // // Initialization @@ -311,7 +316,7 @@ if (count($alphaLocs) <= 0) continue; $letter = strtoupper($alpha); - asort($alphaLocs, SORT_STRING); + uasort($alphaLocs, "locCompare"); echo "<h3 class=\"alpha\"><a id=\"ch".$letter."\"></a>".$letter."</h3>\n".