PHP Velho Oeste 2024

HttpResponse::guessContentType

(PECL pecl_http >= 0.13.0)

HttpResponse::guessContentTypeAveriguar tipo de contenido

Descripción

static string HttpResponse::guessContentType ( string $magic_file [, int $magic_mode = MAGIC_MIME ] )

Procura averiguar el tipo de contenido mediante libmagic.

Si tuviera éxito, automáticamente se establecerá este Content-Type al valor del Content-Type de la respuesta.

Parámetros

magic_file

indica la base de datos magic.mime que se utilizará

magic_mode

banderas para libmagic

Valores devueltos

En caso de éxito, devuelve el Content-Type averiguado o FALSE en caso de error.

Errores/Excepciones

Emite HttpRuntimeException, HttpInvalidParamException.

Ver también

add a note add a note

User Contributed Notes

There are no user contributed notes for this page.
To Top