function loadMimeTypes() { $mimeconf = fopen("mimetypes.conf", "r"); while ($line = fgets($mimeconf, 4096)) { $types = explode(" = ", $line); foreach ($types as $type) { $exts = explode(" ", $type[0]); foreach ($exts as $ext) { $this->mimeTypes[$ext] = $type[1]; } } print_r($this->mimeTypes); } } Output from function (printed for each line in the file): Array ( [h] => t [a] => s [c] => s [d] => v [b] => m [o] => d [p] => p [s] => g [x] => m [w] => m [v] => i [g] => i [j] => p [l] => a [n] => c [t] => e [m] => p [u] => s [z] => i [r] => t [i] => g [e] => t [q] => t ) Contents of mimetypes.conf: hqx = application/mac-binhex40 cpt = application/mac-compactpro doc = application/msword bin dms lha lzh exe class so dll = application/octet-stream oda = application/oda pdf = application/pdf ai eps ps = application/postscript smi smil = application/smil xls = application/ms-excel ... etc ...