diff --git a/exif.class.php b/exif.class.php
index 0221a4d..8487d5b 100644
--- a/exif.class.php
+++ b/exif.class.php
@@ -985,6 +985,7 @@ Class Exif {
       $xmp_keys[$current_value] = $current_value;
     }
     $fields = array_merge($exif_keys,$iptc_keys,$xmp_keys);
+	ksort($fields);
     return $fields;
   }
 
