note 61976 added to function.array-multisort

From: Date: Thu, 16 Feb 2006 15:16:04 +0000
Subject: note 61976 added to function.array-multisort
Groups: php.notes 
Request: Send a blank email to php-notes+get-103849@lists.php.net to get a copy of this message
Many thanks to “AlberT at SuperAlberT dot it” for his useful and elegant function. I have made some small alterations so it doesn’t use pass-by-reference as this throws up warnings in newer versions of php4. <?php function array_key_multi_sort($arr, $l , $f='strnatcasecmp') { usort($arr, create_function('$a, $b', "return $f(\$a['$l'], \$b['$l']);")); return($arr); } ?> ---- Server IP: 85.116.0.130 Probable Submitter: 195.194.31.18 (proxied: 195.194.30.29) ---- Manual Page -- http://www.php.net/manual/en/function.array-multisort.php Edit -- http://master.php.net/manage/user-notes.php?action=edit+61976 Delete: added to the manual -- http://master.php.net/manage/user-notes.php?action=delete+61976&report=yes&reason=added+to+the+manual Delete: bad code -- http://master.php.net/manage/user-notes.php?action=delete+61976&report=yes&reason=bad+code Delete: spam -- http://master.php.net/manage/user-notes.php?action=delete+61976&report=yes&reason=spam Delete: useless -- http://master.php.net/manage/user-notes.php?action=delete+61976&report=yes&reason=useless Delete: non-english -- http://master.php.net/manage/user-notes.php?action=delete+61976&report=yes&reason=non-english Delete: already in docs -- http://master.php.net/manage/user-notes.php?action=delete+61976&report=yes&reason=already+in+docs Delete: other reasons -- http://master.php.net/manage/user-notes.php?action=delete+61976&report=yes Reject -- http://master.php.net/manage/user-notes.php?action=reject+61976&report=yes Search -- http://master.php.net/manage/user-notes.php

« previous php.notes (#103849) next »