PHP Class CRUDlex\MimeTypes

Datei anzeigen Open project: philiplb/crudlex Class Usage Examples

Protected Properties

Property Type Description
$mimeTypes THX to http://stackoverflow.com/questions/134833/how-do-i-find-the-mime-type-of-a-file-with-php

Public Methods

Method Description
getMimeType ( string $file ) : string Function to get the mimetype of a file.
getMimeTypeByExtension ( string $file ) : string Gets the mime type by just looking at the extension.
getMimeTypeByFileInfo ( string $file ) : mixed | string Gets the mime type by looking at the file info.

Method Details

getMimeType() public method

Function to get the mimetype of a file.
public getMimeType ( string $file ) : string
$file string the file to get the mimetype from
return string the mimetype

getMimeTypeByExtension() public method

Gets the mime type by just looking at the extension.
public getMimeTypeByExtension ( string $file ) : string
$file string the file to get the mimetype from
return string the mimetype

getMimeTypeByFileInfo() public method

Gets the mime type by looking at the file info.
public getMimeTypeByFileInfo ( string $file ) : mixed | string
$file string the file to get the mimetype from
return mixed | string the mimetype

Property Details

$mimeTypes protected_oe property

THX to http://stackoverflow.com/questions/134833/how-do-i-find-the-mime-type-of-a-file-with-php
protected $mimeTypes