protected function _getFileType($file) { foreach ($this->_fileTypes as $type) { if (stripos($file, DIRECTORY_SEPARATOR . $type . DIRECTORY_SEPARATOR) !== false) { return $type; } } return 'Other'; }