note 69792 deleted from function.usort by danbrown
| From: | danbrown@php.net | Date: | Sun, 23 Jan 2011 16:26:32 +0000 |
| Subject: | note 69792 deleted from function.usort by danbrown | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-176066@lists.php.net to get a copy of this message | ||
Note Submitter: oscahie at gmx dot net
----
To markus:
your function can be simplified to:
<?php
function SortByName($a, $b) {
return strcasecmp($a['name'], $b['name']);
}
usort($test, 'SortByName');
?>
Replace strcasecmp for strcmp if you want case sensitive comparition.