[PHP] Re: Custom Usort Function

2006-01-24 Thread Matt Palermo
Any ideas on how to accomplish this? Matt Palermo [EMAIL PROTECTED] wrote in message news:[EMAIL PROTECTED] I'm try to sort a list of items using a usort function. Basically, I want it to sort in this order: Numbers (0-9) Letters (Aa-Zz) Other (anything else) To explain a little

Re: [PHP] Re: Custom Usort Function

2006-01-24 Thread David Grant
Matt, Personally, I'd do a logic case for each combination, e.g. if (ctype_alpha($x[0])) { if (ctype_alpha($y[0])) { //strcmp } elseif (ctype_digit([$y[0])) { //-1 } else { // 1; } } elseif (ctype_digit([$x[0])) { if (ctype_alpha($y[0])) { //

[PHP] Re: Custom Usort Function

2006-01-24 Thread Al
Matt Palermo wrote: I'm try to sort a list of items using a usort function. Basically, I want it to sort in this order: Numbers (0-9) Letters (Aa-Zz) Other (anything else) To explain a little further, I want anything that starts with a number to show up first in the sorted list, then