public function Response::isContentType

Checks if the Content-Type is of a certain type. This is useful if the Content-Type header contains charset information and you need to know if the Content-Type matches a particular type.

Parameters

string $type Content type to check against:

Return value

bool

File

drupal/core/vendor/guzzle/http/Guzzle/Http/Message/Response.php, line 536

Class

Response
Guzzle HTTP response object

Namespace

Guzzle\Http\Message

Code

public function isContentType($type) {
  return stripos($this
    ->getContentType(), $type) !== false;
}