Hi, i have a directory where i store some jpegs...a page lists all the files in this dir:
$dir = opendir($current_dir); $dir = opendir($current_dir); while ($file = readdir($dir)) { i display them in a table } is there a way to alphabetize the names
Try somrthing like this:
$dir = opendir($current_dir); while ($file = readdir($dir)) { $files[] = $file; }
natcasesort($files); reset($files);
foeach($files as $file) { echo '<BR>'.$file; }
THanks, does the trick