View Single Post
Old 12-16-2009, 01:42 AM   #2 (permalink)
etoolbox
The Wanderer
Newcomer 
 
etoolbox's Avatar
 
Join Date: Dec 2008
Location: Auckland, NZ
Posts: 24
Thanks: 0
etoolbox is on a distinguished road
Default

It will correctly sort the data in the $files array. But you are not using the $files array to render your data as HTML so the rendered output is not sorted.

Do this instead:
PHP Code:
while (false !== ($filename readdir($dh))) {
    
$files[] = $filename;
}
sort($files);

foreach(
$files as $filename) {
    
// now render the html here

__________________
Chris Hope's LAMP Blog: http://www.electrictoolbox.com/
etoolbox is offline  
Reply With Quote