Skip to content

Simple library to provide common interface for encoding / decoding MIME types

License

Notifications You must be signed in to change notification settings

vertilia/mime-type

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

6 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

mime-type

Simple library to provide common interface for encoding / decoding MIME types.

<?php

use Vertilia\MimeType\MimeTime;

print_r(MimeTime::get('application/json')->decode('{"a":[1,2,3]}', JSON_OBJECT_AS_ARRAY));
print_r(MimeTime::get('application/x-www-form-urlencoded')->decode('a[]=1&a[]=2&a[]=3'));

Both calls from the above snippet first return the object corresponding to provided MIME type, and then they decode the content of that MIME type with the same resulting array.

Both calls display the same result:

Array
(
    [a] => Array
        (
            [0] => 1
            [1] => 2
            [2] => 3
        )
)

About

Simple library to provide common interface for encoding / decoding MIME types

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages