blasterstudios
Technical User
I have a list of files showing up on a page that i scraped together from php.net. I need to sort these files alphabetically. The only thing i've read about sorting is that they have to be in an array, and I have trouble with arrays. Here's my code to get the files:
Code:
$startdir = $orgdir . "/files/";
$handle = $startdir;
if ($handle = opendir($startdir)) {
while (false !== ($file = readdir($handle))) {
$filetype = explode(".", $file);
if ($file != "." && $file != ".." && $file != "index.html" && $file != "index.php") {
echo "<a href=\"" . $startdir . $file; . "\" target=\"_blank\">" . $file . "</a>"; }