Re: Order of arrays
| From: | Marek Kilimajer | Date: | Fri, 22 Nov 2002 15:03:23 +0000 |
| Subject: | Re: Order of arrays | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-125617@lists.php.net to get a copy of this message | ||
Use usort
Mako Shark wrote:
I don't think a simple sort() will do this. Is there a way I can sort these following array values so that all will be in numerical order, and then alphabetical after that? I need Dirfiles/97 Dirfiles/98 Dirfiles/99 Dirfiles/100 Dirfiles/101 Dirfiles/102 Dirfiles/ABG1 Dirfiles/ABG2 in that order. They could originally be in any seemingly random order, but when I'm done with it, I need them in that order. Is there a way to do it? A simple string sort() won't work since 9 comes after 1 and it'll order it like 'Dirfiles/100,101,102,97,98,99,ABG1,ABG2'. Any ideas? For some reason, natsort() won't work. __________________________________________________ Do you Yahoo!? Yahoo! Mail Plus Powerful. Affordable. Sign up now. http://mailplus.yahoo.com