note 98308 added to function.array-multisort
| From: | m__faraz at hotmail dot com | Date: | Tue, 08 Jun 2010 15:10:00 +0000 |
| Subject: | note 98308 added to function.array-multisort | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-169943@lists.php.net to get a copy of this message | ||
The last example for multisort an array by a text field works well.
However, it is case sensitive.
So here is my version of the same with case insensitivity.
<?php
$tmp = Array();
foreach($aMultiArray as &$aSingleArray) $tmp[] = &$aSingleArray["name"];
$tmp = array_map('strtolower', $tmp);
array_multisort($tmp, $aMultiArray);
?>
Hope this helps someone out there.
----
Server IP: 69.147.83.197
Probable Submitter: 203.99.177.226
----
Manual Page -- http://www.php.net/manual/en/function.array-multisort.php
Edit -- https://master.php.net/note/edit/98308
Del: integrated -- https://master.php.net/note/delete/98308/integrated
Del: useless -- https://master.php.net/note/delete/98308/useless
Del: bad code -- https://master.php.net/note/delete/98308/bad+code
Del: spam -- https://master.php.net/note/delete/98308/spam
Del: non-english -- https://master.php.net/note/delete/98308/non-english
Del: in docs -- https://master.php.net/note/delete/98308/in+docs
Del: other reasons-- https://master.php.net/note/delete/98308
Reject -- https://master.php.net/note/reject/98308
Search -- https://master.php.net/manage/user-notes.php