HttpResponse
PHP 手册

HttpResponse::send

(PECL pecl_http >= 0.10.0)

HttpResponse::sendSend response

说明

static bool HttpResponse::send ([ bool $clean_ob = true ] )

Finally send the entity.

A successful caching attempt will exit PHP, and write a log entry if the INI 设置 http.log.cache is set. 要知道“出口”的含义请查阅 INI 设置 http.force_exit

参数

clean_ob

whether to destroy all previously started output handlers and their buffers

返回值

成功时返回 TRUE, 或者在失败时返回 FALSE

范例

Example #1 A HttpResponse::send() example

<?php
HttpResponse
::setCache(true);
HttpResponse::setContentType('application/pdf');
HttpResponse::setContentDisposition("$user.pdf"false);
HttpResponse::setFile('sheet.pdf');
HttpResponse::send();
?>

参见


HttpResponse
PHP 手册