private function getMime($file) {
		
		$info	= new \stdClass;

		$audio	= array ('audio/basic','audio/mpeg');//,'audio/x-aiff','audio/x-pn-realaudio','audio/wav','audio/x-wav');
		$docs	= array ('text/plain','application/pdf','application/msword','application/vnd.ms-excel','application/vnd.ms-powerpoint');
		$flash	= array ('application/x-shockwave-flash');
		$images = array ('image/gif','image/jpeg','image/png','image/svg+xml','image/tiff');
		$movies = array ('video/mpeg','video/mp4','video/quicktime','video/webm','video/x-flv','video/x-msvideo','video/x-ms-asf');
		$zip	= array ('application/zip');
		
		// reads MIME with the best function
		if (function_exists('mime_content_type')) {
			
			$info->mime = mime_content_type($file);
			
		} else if (extension_loaded('fileinfo') or dl('fileinfo.so')) {
			
			$const = defined('FILEINFO_MIME_TYPE') ? FILEINFO_MIME_TYPE : FILEINFO_MIME;
			$finfo = finfo_open($const);
			$info->mime = finfo_file($finfo, $file);
			finfo_close($finfo);
			
		} else {
			
			$this->setError('No extensions available for this file');
			$info->mime = NULL;
			$info->type = NULL;
			return $info;
			
		}

		// parses variable’s MIME and set its type
		if (in_array($info->mime, $docs)) {
			$info->type = 'document';
		} else if (in_array($info->mime, $movies)) {
			$info->type = 'movie';
		} else if (in_array($info->mime, $images)) {
			$info->type = 'image';
		} else if (in_array($info->mime, $flash)) {
			$info->type = 'flash';
		} else if (in_array($info->mime, $audio)) {
			$info->type = 'audio';
		} else if (in_array($info->mime, $zip)) {
			$info->type = 'zip';
		} else {
			$info->type = 'unknown';
		}

		return $info;
		
	}
private function getMime($file) {
		
		$info	= new \stdClass;

		$audio	= array ('audio/basic','audio/mpeg');//,'audio/x-aiff','audio/x-pn-realaudio','audio/wav','audio/x-wav');
		$docs	= array ('text/plain','application/pdf','application/msword','application/vnd.ms-excel','application/vnd.ms-powerpoint');
		$flash	= array ('application/x-shockwave-flash');
		$images = array ('image/gif','image/jpeg','image/png','image/svg+xml','image/tiff');
		$movies = array ('video/mpeg','video/mp4','video/quicktime','video/webm','video/x-flv','video/x-msvideo','video/x-ms-asf');
		$zip	= array ('application/zip');
		
		// reads MIME with the best function
		if (function_exists('mime_content_type')) {
			
			$info->mime = mime_content_type($file);
			
		} else if (extension_loaded('fileinfo') or dl('fileinfo.so')) {
			
			$const = defined('FILEINFO_MIME_TYPE') ? FILEINFO_MIME_TYPE : FILEINFO_MIME;
			$finfo = finfo_open($const);
			$info->mime = finfo_file($finfo, $file);
			finfo_close($finfo);
			
		} else {
			
			$this->setError('No extensions available for this file');
			$info->mime = NULL;
			$info->type = NULL;
			return $info;
			
		}

		// parses variable’s MIME and set its type
		if (in_array($info->mime, $docs)) {
			$info->type = 'document';
		} else if (in_array($info->mime, $movies)) {
			$info->type = 'movie';
		} else if (in_array($info->mime, $images)) {
			$info->type = 'image';
		} else if (in_array($info->mime, $flash)) {
			$info->type = 'flash';
		} else if (in_array($info->mime, $audio)) {
			$info->type = 'audio';
		} else if (in_array($info->mime, $zip)) {
			$info->type = 'zip';
		} else {
			$info->type = 'unknown';
		}

		return $info;
		
	}
private function getMime ( $ file ) { $ info = new \ stdClass ; $ audio = array ( 'audio/basic' , 'audio/mpeg' ) ; //,'audio/x-aiff','audio/x-pn-realaudio','audio/wav','audio/x-wav');
 $ docs = array ( 'text/plain' , 'application/pdf' , 'application/msword' , 'application/vnd.ms-excel' , 'application/vnd.ms-powerpoint' ) ; $ flash = array ( 'application/x-shockwave-flash' ) ; $ images = array ( 'image/gif' , 'image/jpeg' , 'image/png' , 'image/svg+xml' , 'image/tiff' ) ; $ movies = array ( 'video/mpeg' , 'video/mp4' , 'video/quicktime' , 'video/webm' , 'video/x-flv' , 'video/x-msvideo' , 'video/x-ms-asf' ) ; $ zip = array ( 'application/zip' ) ; // reads MIME with the best function
 if ( function_exists ( 'mime_content_type' ) ) { $ info -> mime = mime_content_type ( $ file ) ; } else if ( extension_loaded ( 'fileinfo' ) or dl ( 'fileinfo.so' ) ) { $ const = defined ( 'FILEINFO_MIME_TYPE' ) ? FILEINFO_MIME_TYPE : FILEINFO_MIME ; $ finfo = finfo_open ( $ const ) ; $ info -> mime = finfo_file ( $ finfo , $ file ) ; finfo_close ( $ finfo ) ; } else { $ this -> setError ( 'No extensions available for this file' ) ; $ info -> mime = NULL ; $ info -> type = NULL ; return $ info ; } // parses variable’s MIME and set its type
 if ( in_array ( $ info -> mime , $ docs ) ) { $ info -> type = 'document' ; } else if ( in_array ( $ info -> mime , $ movies ) ) { $ info -> type = 'movie' ; } else if ( in_array ( $ info -> mime , $ images ) ) { $ info -> type = 'image' ; } else if ( in_array ( $ info -> mime , $ flash ) ) { $ info -> type = 'flash' ; } else if ( in_array ( $ info -> mime , $ audio ) ) { $ info -> type = 'audio' ; } else if ( in_array ( $ info -> mime , $ zip ) ) { $ info -> type = 'zip' ; } else { $ info -> type = 'unknown' ; } return $ info ; }
Will returns Mime and Type for the file as parameter.

@param	string	Path to file.
@return	obj
Will returns Mime and Type for the file as parameter .