Asf_Http_Response::setContentType

设置header头 content-type 、 charset


Description

public bool setContentType(string $ctype, string $charset)

Parameters

ctype

content-type值; eg: text/html; text/plain

charset

页面编码; eg: UTF_8 默认

Return Values

设置成功返回 true

Examples

Example #1

<?php
use Asf\Http\Response;

$rep = new Response();

var_dump($rep->setContentType("text/plain", "UTF-8"));
var_dump($rep->setContent("Hello"));

/* 输出值 */

bool(true)
bool(true)