note 115550 deleted from function.array-multisort by salathe
| From: | salathe@php.net | Date: | Fri, 22 Aug 2014 08:10:11 +0000 |
| Subject: | note 115550 deleted from function.array-multisort by salathe | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-200262@lists.php.net to get a copy of this message | ||
Note Submitter: pramodtvm1 at gmail dot com
----
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
)