Array $filelist = array(); //Open up da dir if ($handle = opendir('.')) { //Read file name as var while ($file = readdir($handle)) { //Files you don't need to see if ($file != $me && $file != in_array($file, $exclude) && substr($file,0,1) != '.') { //Populate file list array with t3h safe filez!eleventy1! $filelist[] = $file; } } //Bye Bye dir closedir($handle); } //We need order asort($filelist); //Loop through the array. foreach ($filelist as $file) { //To remove the extension from the anchor title $fileext = explode('.', $file); $ZomgFile = substr($file, 0, -1*(strlen(count($fileext)-1)+1); //Print meh filez! echo "\r\n
"; } ?>