📄 function.httpresponse-send.html
字号:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"><html> <head> <title>Send response</title> <meta http-equiv="content-type" content="text/html; charset=UTF-8"> </head> <body><div style="text-align: center;"> <div class="prev" style="text-align: left; float: left;"><a href="function.httpresponse-redirect.html">HttpResponse::redirect</a></div> <div class="next" style="text-align: right; float: right;"><a href="function.httpresponse-setbuffersize.html">HttpResponse::setBufferSize</a></div> <div class="up"><a href="class.httpresponse.html">The HttpResponse</a></div> <div class="home"><a href="index.html">PHP Manual</a></div></div><hr /><div id="function.httpresponse-send" class="refentry"> <div class="refnamediv"> <h1 class="refname">HttpResponse::send</h1> <p class="verinfo">(PECL pecl_http:0.10.0-1.5.5)</p><p class="refpurpose"><span class="refname">HttpResponse::send</span> — <span class="dc-title">Send response</span></p> </div> <div class="refsect1 description"> <h3 class="title">Description</h3> <div class="methodsynopsis dc-description"> <span class="modifier">static</span> <span class="type">bool</span> <span class="methodname"><b><b>HttpResponse::send</b></b></span> ([ <span class="methodparam"><span class="type">bool</span> <tt class="parameter">$clean_ob = TRUE</tt></span> ] )</div> <p class="para rdfs-comment"> Finally send the entity. </p> <p class="para"> A successful caching attempt will exit PHP, and write a log entry if the <a href="http.configuration.html" class="link">INI setting</a> <a href="http.configuration.html#http.configuration.log.cache" class="link">http.log.cache</a> is set. See the <a href="http.configuration.html" class="link">INI setting</a> <a href="http.configuration.html#http.configuration.force_exit" class="link">http.force_exit</a> for what "exits" means. </p> </div> <div class="refsect1 parameters"> <h3 class="title">Parameters</h3> <p class="para"> <dl> <dt> <span class="term"><i><tt class="parameter">clean_ob</tt></i></span> <dd> <p class="para"> whether to destroy all previously started output handlers and their buffers </p> </dd> </dt> </dl> </p> </div> <div class="refsect1 returnvalues"> <h3 class="title">Return Values</h3> <p class="para"> Returns <b><tt>TRUE</tt></b> on success or <b><tt>FALSE</tt></b> on failure. </p> </div> <div class="refsect1 examples"> <h3 class="title">Examples</h3> <p class="para"> <div class="example"> <p><b>Example #1 A <b>HttpResponse::send()</b> example</b></p> <div class="example-contents"><div class="phpcode"><code><span style="color: #000000"><span style="color: #0000BB"><?php<br />HttpResponse</span><span style="color: #007700">::</span><span style="color: #0000BB">setCache</span><span style="color: #007700">(</span><span style="color: #0000BB">true</span><span style="color: #007700">);<br /></span><span style="color: #0000BB">HttpResponse</span><span style="color: #007700">::</span><span style="color: #0000BB">setContentType</span><span style="color: #007700">(</span><span style="color: #DD0000">'application/pdf'</span><span style="color: #007700">);<br /></span><span style="color: #0000BB">HttpResponse</span><span style="color: #007700">::</span><span style="color: #0000BB">setContentDisposition</span><span style="color: #007700">(</span><span style="color: #DD0000">"$user.pdf"</span><span style="color: #007700">, </span><span style="color: #0000BB">false</span><span style="color: #007700">);<br /></span><span style="color: #0000BB">HttpResponse</span><span style="color: #007700">::</span><span style="color: #0000BB">setFile</span><span style="color: #007700">(</span><span style="color: #DD0000">'sheet.pdf'</span><span style="color: #007700">);<br /></span><span style="color: #0000BB">HttpResponse</span><span style="color: #007700">::</span><span style="color: #0000BB">send</span><span style="color: #007700">();<br /></span><span style="color: #0000BB">?></span></span></code></div> </div> </div> </p> </div> <div class="refsect1 seealso"> <h3 class="title">See Also</h3> <p class="para"> <ul class="simplelist"> <li class="member"> <span class="methodname"><b><a href="function.httpresponse-capture.html" class="function" rel="rdfs-seeAlso">HttpResponse::capture</a></b></span></li> </ul> </p> </div></div><hr /><div style="text-align: center;"> <div class="prev" style="text-align: left; float: left;"><a href="function.httpresponse-redirect.html">HttpResponse::redirect</a></div> <div class="next" style="text-align: right; float: right;"><a href="function.httpresponse-setbuffersize.html">HttpResponse::setBufferSize</a></div> <div class="up"><a href="class.httpresponse.html">The HttpResponse</a></div> <div class="home"><a href="index.html">PHP Manual</a></div></div></body></html>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -