public static function getMagicType($file_path) {
		$file_info = finfo_open(FILEINFO_MIME_TYPE);
		$mime_type = finfo_file($file_info, $file_path);
		finfo_close($file_info);

		// Only return valid types, in order to maintain circular compatibility between methods.
		if (static::hasType($mime_type)) {
			return $mime_type;
		}
	}
public static function getMagicType($file_path) {
		$file_info = finfo_open(FILEINFO_MIME_TYPE);
		$mime_type = finfo_file($file_info, $file_path);
		finfo_close($file_info);

		// Only return valid types, in order to maintain circular compatibility between methods.
		if (static::hasType($mime_type)) {
			return $mime_type;
		}
	}
public static function getMagicType ( $ file_path ) { $ file_info = finfo_open ( FILEINFO_MIME_TYPE ) ; $ mime_type = finfo_file ( $ file_info , $ file_path ) ; finfo_close ( $ file_info ) ; // Only return valid types, in order to maintain circular compatibility between methods. if ( static :: hasType ( $ mime_type ) ) { return $ mime_type ; } }
Get the MIME type of a file using magic.

@param string $file_path Relative or absolute path to an existing file.

@return string|null The associated MIME type or null if no known type was detected.
Get the MIME type of a file using magic .