note 115550 added to function.array-multisort
| From: | pramodtvm1 at gmail dot com | Date: | Thu, 14 Aug 2014 02:45:03 +0000 |
| Subject: | note 115550 added to function.array-multisort | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-200186@lists.php.net to get a copy of this message | ||
We can do the case insensitive sorting using the flag SORT_FLAG_CASE. So the example #4 can be
updated like this
$array = array('Alpha', 'atomic', 'Beta', 'bank');
$array_lowercase = array_map('strtolower', $array);
array_multisort($array, SORT_ASC, SORT_STRING | SORT_FLAG_CASE);
print_r($array);
Output
Array
(
[0] => Alpha
[1] => atomic
[2] => bank
[3] => Beta
)
----
Server IP: 72.52.91.14
Probable Submitter: 180.215.6.210
----
Manual Page -- http://php.net/manual/en/function.array-multisort.php
Edit -- https://master.php.net/note/edit/115550
Del: integrated -- https://master.php.net/note/delete/115550/integrated
Del: useless -- https://master.php.net/note/delete/115550/useless
Del: bad code -- https://master.php.net/note/delete/115550/bad+code
Del: spam -- https://master.php.net/note/delete/115550/spam
Del: non-english -- https://master.php.net/note/delete/115550/non-english
Del: in docs -- https://master.php.net/note/delete/115550/in+docs
Del: other reasons-- https://master.php.net/note/delete/115550
Reject -- https://master.php.net/note/reject/115550
Search -- https://master.php.net/manage/user-notes.php