Comunitatea PHP Romania
 

 
Editing MIME types

Editing MIME types

Editing MIME types -- How to change things

Editing a MIME type

With MIME_Type, you can edit existing MIME types or create new ones from scratch. Just create a new instance of MIME_Type - with the MIME type string as only parameter, if you have one - or no parameter if you want to begin a new one.

To set or retrieve the media type (part before the slash), use the object's $media property. The same applies to the subtype, the property name is $subType.

If you are done editing your MIME type, use get() to retrieve the MIME type's string representation.

Working with parameters

To retrieve parameters, use the $parameters property. It is an array consisting of MIME_Type_Parameter objects if there are any.

You can remove any parameter by calling removeParameter() and passing the parameter's name as only parameter.

Parameters are added with addParameter(). It takes the $name, $value and an optional $comment as parameters.

Again: If you are done editing the parameters, use get() to retrieve the MIME type's string representation.

There are three static methods that help you working with parameters:

  • hasParameters() checks if the passed MIME type string has any parameters in it.

  • getParameters() returns an array of MIME_Type_Parameter objects if there are any parameters in the passed type string.

  • stripParameters() removes all parameters and comments from the given type string.

Ultimele discutii in forum RSS Forum

Ultimele articole Ultimele articole

Top membri

Pirahna Pirahna
la birou
carco carco
Bucuresti
Birkoff Birkoff
Bucuresti
mihaitha mihaitha
Sibiu
Mascka Mascka
Braila
gabysolomon gabysolomon
Bacau
whooper whooper
Toronto ON
raul_ raul_
dechim dechim
Drobeta Turnu Severin
Amenthes Amenthes

Newsletter


Email:
 inscriere
 renuntare
 
 Arhiva newsletter

Parteneriat

Copyright © 2001-2008 PHP Romania Add PHPRomania to Google Add PHPRomania to Del.icio.us Add PHPRomania to Stumbleupon Add PHPRomania to Yahoo! Add PHPRomania to Digg Add PHPRomania to Blink 0% Balance Transfers | Myspace Proxy | Loan | Mortgage Calculator | Fast Loans
Ads: Partener Way2Web Nework: gazduire web | inregistrare domenii | web design | imobiliare | web hosting
Powered by Simplis