Home > PHP > Function > > HttpResponse::setContentType()

HttpResponse::setContentType()

HttpResponse::setContentType - Set content type

Syntax

static HttpResponse::setContentType (string $content_type)

Arguments

  • content_type - the content type of the sent entity (primary/secondary)

Description

Set the Content-Typeof the sent entity.

Version

PHP PECL pecl_http >= 0.10.0

Return value

Returns TRUE on success, or FALSE if the content type does not seem to contain a primary and secondary content type part.