php sort using associative array

I'm using krsort, ksort, arsort and asort in a script. Fine all goes perfectly, except that the sort field is based on file names from the directory contents, and they are (historically) ugly, as in MMDDYY, not YYYYMMDD, causing the different years to be interspersed together.
if($_GET['sort'] == 'alpha'){
if($_GET['mode'] == 'desc'){
krsort($files);
$highlight = 'alpha_desc';
} else {
ksort($files);
$highlight = 'alpha_asc';
}
} else {
if($_GET['mode'] == 'asc'){
asort($files, SORT_NUMERIC);
$highlight = 'date_asc';
} else {
arsort($files, SORT_NUMERIC);
$highlight = 'date_desc';
}
}
Thanks & regards
Lokananth
[url=http://www.mioot.com]Live Chat Software[/url] By miOOt
Sign In or Register to comment.

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Categories