public static function detect_mime_type($path) {
		$handle = finfo_open(FILEINFO_MIME);
		$mime_type = finfo_file($handle, $path);

		if (strpos($mime_type, ';')) {
			$mime_type = preg_replace('/;.*/', ' ', $mime_type);
		}

		return trim($mime_type);
	}
public static function detect_mime_type($path) {
		$handle = finfo_open(FILEINFO_MIME);
		$mime_type = finfo_file($handle, $path);

		if (strpos($mime_type, ';')) {
			$mime_type = preg_replace('/;.*/', ' ', $mime_type);
		}

		return trim($mime_type);
	}
public static function detect_mime_type ( $ path ) { $ handle = finfo_open ( FILEINFO_MIME ) ; $ mime_type = finfo_file ( $ handle , $ path ) ; if ( strpos ( $ mime_type , ';' ) ) { $ mime_type = preg_replace ( '/;.*/' , ' ' , $ mime_type ) ; } return trim ( $ mime_type ) ; }
Get the mime_type of a file

@access public
@param string $file The path to the file
@return string $mime_type
Get the mime_type of a file