Skip to content

nishadil/extmime

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

20 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Nishadil\Extmime

The "Nishadil\Extmime" PHP package offers a convenient solution for developers seeking to effortlessly convert between file MIME types and extensions within their projects. By leveraging this package, developers can seamlessly map MIME types to file extensions and vice versa, simplifying file handling tasks.

How to install

To integrate "Nishadil\Extmime" into your project, simply clone this git repo or use Composer with the following command:

composer require nishadil/extmime

How to use

Get mime type from file extension

    <?php
    
    use Nishadil\Extmime;

    $extmime = new Extmime;
    $result = $extmime->getExtension("image/jpeg");

    echo $result;
    ?>

Output :

    .jpg

Get extension from file mime type

    <?php
    
    use Nishadil\Extmime;

    $extmime = new Extmime;
    $result = $extmime->getMimeType(".jpg");

    echo $result;
    ?>

Output :

    .image/jpeg

About

PHP package for converting file MIME Type to extension and vice versa.

Topics

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages