Here's the code with the array:

PHP Code:
  if ($open = @opendir($home_directory.$path))
  {
   for(
$i=0;($file readdir($open)) != FALSE;$i++)
    if (
is_file($home_directory.$path.$file) && !is_hidden_file($home_directory.$path.$file))
    {
     
$icon get_icon($file);
     
$filesize filesize($home_directory.$path.$file);
     
$permissions decoct(fileperms($home_directory.$path.$file)%01000);
     
$modified filemtime($home_directory.$path.$file);
     
$extension "";
     
$files[$i] = array(
                         
"icon"        => $icon,
                         
"filename"    => $file,
                         
"filesize"    => $filesize,
                         
"permissions" => $permissions,
                         
"modified"    => $modified,
                         
"extension"   => $extension,
                       );
    }
   
closedir($open);

   if (isset(
$files))
   {
    
usort($files"compare_filedata");
    
reset($files);
   }
  } 
How can I add functionality to sort by file extension?