Sanitizes a mime type
Parameters
$mime_type
stringrequired- Mime type.
Source
/**
* Sanitizes a mime type
*
* @since 3.1.3
*
* @param string $mime_type Mime type.
* @return string Sanitized mime type.
*/
function sanitize_mime_type( $mime_type ) {
$sani_mime_type = preg_replace( '/[^-+*.a-zA-Z0-9\/]/', '', $mime_type );
/**
Changelog
Version | Description |
---|---|
3.1.3 | Introduced. |
Output:
typeexample1-/.pdf
Basic Usage