class File

Methods

static bool
isImage(string $data)

Check if the given MIME type or extension is an image.

static bool
isVideo(string $data)

Check if the given MIME type or extension is a video.

static string
getExtensionFromString(string $string)

Get the file extension from a filename string.

static string|false
getExtensionFromMIME(string $mime)

Get the file extension from a MIME type.

static string|false
getMIME(string $extension)

Get the MIME type from a file extension.

static array
image_MIME()

Get all image MIME types.

static array
application_MIME()

Get all application MIME types.

static array
audio_MIME()

Get all audio MIME types.

static array
message_MIME()

Get all message MIME types.

static array
text_MIME()

Get all text MIME types.

static array
video_MIME()

Get all video MIME types.

static array
x_world_MIME()

Get all x-world MIME types.

static array
all_MIME()

Get all supported MIME types.

Details

at line 12
static bool isImage(string $data)

Check if the given MIME type or extension is an image.

Parameters

string $data

MIME type or extension

Return Value

bool

at line 22
static bool isVideo(string $data)

Check if the given MIME type or extension is a video.

Parameters

string $data

MIME type or extension

Return Value

bool

at line 32
static string getExtensionFromString(string $string)

Get the file extension from a filename string.

Parameters

string $string Filename

Return Value

string

at line 42
static string|false getExtensionFromMIME(string $mime)

Get the file extension from a MIME type.

Parameters

string $mime

MIME type

Return Value

string|false

at line 52
static string|false getMIME(string $extension)

Get the MIME type from a file extension.

Parameters

string $extension

File extension

Return Value

string|false

at line 61
static array image_MIME()

Get all image MIME types.

Return Value

array

at line 94
static array application_MIME()

Get all application MIME types.

Return Value

array

at line 220
static array audio_MIME()

Get all audio MIME types.

Return Value

array

at line 242
static array message_MIME()

Get all message MIME types.

Return Value

array

at line 255
static array text_MIME()

Get all text MIME types.

Return Value

array

at line 284
static array video_MIME()

Get all video MIME types.

Return Value

array

at line 310
static array x_world_MIME()

Get all x-world MIME types.

Return Value

array

at line 326
static array all_MIME()

Get all supported MIME types.

Return Value

array