note 69792 added to function.usort
| From: | oscahie at gmx dot net | Date: | Thu, 21 Sep 2006 10:51:27 +0000 |
| Subject: | note 69792 added to function.usort | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-117374@lists.php.net to get a copy of this message | ||
To markus:
your function can be simplified to:
function SortByName($a, $b) {
return strcasecmp($a['name'], $b['name']);
}
usort($test, 'SortByName');
Replace strcasecmp for strcmp if you want case sensitive comparition.
----
Server IP: 64.71.164.2
Probable Submitter: 129.35.231.2 (proxied: 1.0 defrqcpc21dbkf6 (NetCache NetApp/6.0.4))
----
Manual Page -- http://www.php.net/manual/en/function.usort.php
Edit -- https://master.php.net/note/edit/69792
Del: integrated -- https://master.php.net/note/delete/69792/integrated
Del: useless -- https://master.php.net/note/delete/69792/useless
Del: bad code -- https://master.php.net/note/delete/69792/bad+code
Del: spam -- https://master.php.net/note/delete/69792/spam
Del: non-english -- https://master.php.net/note/delete/69792/non-english
Del: in docs -- https://master.php.net/note/delete/69792/in+docs
Del: other reasons-- https://master.php.net/note/delete/69792
Reject -- https://master.php.net/note/reject/69792
Search -- https://master.php.net/manage/user-notes.php