Package home | Report new bug | New search | Development Roadmap Status: Open | Feedback | All | Closed Since Version 0.2.0dev1

Request #12018 array_multisort without lowercase possibility for columns also with capitals
Submitted: 2007-09-11 08:15 UTC
From: horizons Assigned: wiesemann
Status: Closed Package: Structures_DataGrid_DataSource_Array
PHP Version: Irrelevant OS: Linux
Roadmaps: (Not assigned)    
Subscription  
Comments Add Comment Add patch


Anyone can comment on a bug. Have a simpler test case? Does it work for you on a different platform? Let us know! Just going to say 'Me too!'? Don't clutter the database with that please !
Your email address:
MUST BE VALID
Solve the problem : 47 + 9 = ?

 
 [2007-09-11 08:15 UTC] horizons (Stuart Angle)
Description: ------------ Whenever I have a array which has also words with characters in a datagrid column the array_multisort call in the function sort offers no possibibility to be able to sort after the lowercase column like below. because if i use the datagrid together with HMTL_TABLE and HTML_QuickForm_DHTMLRulesTableless I am not able to change this sort behavior. there should be a possibility to set some sorting options for different columns, like sort_numeric, sort_string_lowercase, sort_string ect. Test script: --------------- $array = array('Alpha', 'atomar', 'Beta', 'bank'); $array_lowercase = array_map('strtolower', $array); array_multisort($array_lowercase, SORT_ASC, SORT_STRING,$array); print_r($array); with the normal array_multisort the array would be Array ( [0] => Alpha [1] => Beta [2] => atomar [3] => bank ) but should be if i want to sort ascending. Array ( [0] => Alpha [1] => atomar [2] => bank [3] => Beta )

Comments

 [2007-09-11 08:23 UTC] wiesemann (Mark Wiesemann)
This is not really a bug. But we already planned exactly this change, and actually the change code is already on my harddisk, but not yet committed to CVS. There will be a new option that allows you to switch the sorting order.
 [2007-09-12 21:06 UTC] wiesemann (Mark Wiesemann)
This bug has been fixed in CVS. If this was a documentation problem, the fix will appear on pear.php.net by the end of next Sunday (CET). If this was a problem with the pear.php.net website, the change should be live shortly. Otherwise, the fix will appear in the package's next release. Thank you for the report and for helping us make PEAR better. --- There is now a new option ('natsort') that allows to change the sorting order.