php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Request #69726 Sorting: Locale aware Natural Sorting
Submitted: 2015-05-29 07:41 UTC Modified: 2015-05-29 11:30 UTC
Votes:1
Avg. Score:5.0 ± 0.0
Reproduced:1 of 1 (100.0%)
Same Version:0 (0.0%)
Same OS:0 (0.0%)
From: opitz dot alexander at googlemail dot com Assigned: cmb (profile)
Status: Closed Package: *General Issues
PHP Version: master-Git-2015-05-29 (Git) OS: All
Private report: No CVE-ID: None
 [2015-05-29 07:41 UTC] opitz dot alexander at googlemail dot com
Description:
------------
There are 3 types of string sortings, binary, locale aware and natural. But there is no way to sort natural AND locale aware.

References: #12653 #19795 #38203 #61023

As it isn't possible to reopen issues and closed issues won't be read, I created this new one, as we like to use this in TYPO3.CMS.


Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2015-05-29 11:18 UTC] cmb@php.net
-Status: Open +Status: Feedback -Assigned To: +Assigned To: cmb
 [2015-05-29 11:18 UTC] cmb@php.net
The intl extension already provides such a facility:

    <?php
    
    $a = ['bücher','buch10','buch2','buch1'];
    
    $coll = new Collator('de_DE');
    $coll->setAttribute(Collator::NUMERIC_COLLATION, Collator::ON);
    $coll->sort($a);
    
    print_r($a);

    ?>
    
Is that what you're looking for?
 [2015-05-29 11:30 UTC] opitz dot alexander at googlemail dot com
-Status: Feedback +Status: Closed
 [2015-05-29 11:30 UTC] opitz dot alexander at googlemail dot com
Ok, fine, didn't found this solution yet elsewhere only all the requests.

http://3v4l.org/RHPkY

Works.
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Fri Apr 26 15:01:56 2024 UTC