com web/people: sort user listing by username: include/misc.php

From: Date: Wed, 07 Aug 2019 19:17:33 +0000
Subject: com web/people: sort user listing by username: include/misc.php
Groups: php.webmaster 
Request: Send a blank email to php-webmaster+get-28285@lists.php.net to get a copy of this message
Commit: a7f3c67dfce30446d903413bd6658008251f3634 Author: Peter Cowburn <salathe@php.net> Wed, 7 Aug 2019 20:16:20 +0100 Parents: bd8fdb6f3a0b4e077895a39cc9e49c6661508773 Branches: master Link: http://git.php.net/?p=web/people.git;a=commitdiff;h=a7f3c67dfce30446d903413bd6658008251f3634 Log: sort user listing by username _batman_ takes first place! Changed paths: M include/misc.php Diff: diff --git a/include/misc.php b/include/misc.php index fd51c0a...db57b81 100644 --- a/include/misc.php +++ b/include/misc.php @@ -32,6 +32,10 @@ function findAllUsers($page) { error($json["error"]); } + usort($json, function ($a, $b) { + return strcmp($a["username"], $b["username"]); + }); + $offset = ($page - 1) * 50; return array_slice($json, $offset, 50); }

« previous php.webmaster (#28285) next »