problems sorting an array

    Date: 05/24/06 (PHP Community)    Keywords: html

    i have an array
    Array ( [0] => . [1] => .. [2] => index.html [3] => shouts_1-100.html [4] => shouts_1001-1100.html [5] => shouts_101-200.html [6] => shouts_201-300.html [7] => shouts_301-400.html [8] => shouts_401-500.html [9] => shouts_501-600.html [10] => shouts_601-700.html [11] => shouts_701-800.html [12] => shouts_801-900.html [13] => shouts_901-1000.html )

    however i'm trying to reserve sort it, numerically so i thought rsort($array, SORT_NUMERIC):
    Array ( [0] => shouts_901-1000.html [1] => shouts_801-900.html [2] => shouts_701-800.html [3] => shouts_601-700.html [4] => shouts_501-600.html [5] => shouts_401-500.html [6] => shouts_301-400.html [7] => shouts_201-300.html [8] => shouts_101-200.html [9] => shouts_1001-1100.html [10] => shouts_1-100.html [11] => index.html [12] => .. [13] => . )

    however as you can see, i still have a problem what should be at the 0 key is shouts_1001-1100.html. is there anyway to sort this array numerically without it grouping together numbers at the first digit?

    Source: http://community.livejournal.com/php/452803.html

« Strange Problem. || The Blogger of DOOM! »


antivirus | apache | asp | blogging | browser | bugtracking | cms | crm | css | database | ebay | ecommerce | google | hosting | html | java | jsp | linux | microsoft | mysql | offshore | offshoring | oscommerce | php | postgresql | programming | rss | security | seo | shopping | software | spam | spyware | sql | technology | templates | tracker | virus | web | xml | yahoo | home