PDA

View Full Version : Folders Listing Alphabetically


Boofo
03-28-2003, 05:29 AM
I'm kind of stumped here. What I am trying to do is list the folders alphabetically. So far, I have done that. But what happens now is that it lists it a little backwards. If you have

Testing
testing again
testing once more

it displays it like this

testing again
testing once more
Testing

I need to make it display it right. Here is the code I am using now. Can anyone please help me figure out where I went wrong?

$lowercase=strtolower($thisfolder[1]);
$thefolders["$lowercase|||$thisfolder[1]"]=$thisfolderid;
}
ksort($thefolders);
while(list($thename,$theid)=each($thefolders)){
$thename_tmp=explode("|||",$thename);
$folderjump .= "<option value=\"$theid\" $folderselect[$theid]>$thename_tmp[1]</option>";
}

Brad
03-28-2003, 09:35 AM
Try using:

$lowercase=strtolower($thisfolder[1]);
$thefolders["$lowercase|||$thisfolder[1]"]=$thisfolderid;
}
ksort($thefolders);
reset($thefolders);
while(list($thename,$theid)=each($thefolders)){
$thename_tmp=explode("|||",$thename);
$folderjump .= "<option value=\"$theid\" $folderselect[$theid]>$thename_tmp[1]</option>";
}

Boofo
03-28-2003, 09:52 AM
Sorry, it still lists it the same way. ;)

Boofo
03-29-2003, 03:59 PM
Can anyone else please help me get this working right?