<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> <html> <head> <meta http-equiv="content-type" content="text/html; charset=UTF-8"> <title>Send response</title> </head> <body><div class="manualnavbar" style="text-align: center;"> <div class="prev" style="text-align: left; float: left;"><a href="httpresponse.redirect.html">HttpResponse::redirect</a></div> <div class="next" style="text-align: right; float: right;"><a href="httpresponse.setbuffersize.html">HttpResponse::setBufferSize</a></div> <div class="up"><a href="class.httpresponse.html">HttpResponse</a></div> <div class="home"><a href="index.html">PHP Manual</a></div> </div><hr /><div id="httpresponse.send" class="refentry"> <div class="refnamediv"> <h1 class="refname">HttpResponse::send</h1> <p class="verinfo">(PECL pecl_http >= 0.10.0)</p><p class="refpurpose"><span class="refname">HttpResponse::send</span> — <span class="dc-title">Send response</span></p> </div> <div class="refsect1 description" id="refsect1-httpresponse.send-description"> <h3 class="title">Description</h3> <div class="methodsynopsis dc-description"> <span class="modifier">static</span> <span class="type">bool</span> <span class="methodname"><strong>HttpResponse::send</strong></span> ([ <span class="methodparam"><span class="type">bool</span> <code class="parameter">$clean_ob</code><span class="initializer"> = true</span></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="" class="link">http.log.cache</a> is set. See the <a href="http.configuration.html" class="link">INI setting</a> <a href="" class="link">http.force_exit</a> for what "exits" means. </p> </div> <div class="refsect1 parameters" id="refsect1-httpresponse.send-parameters"> <h3 class="title">Parameters</h3> <p class="para"> <dl> <dt> <span class="term"><em><code class="parameter">clean_ob</code></em></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" id="refsect1-httpresponse.send-returnvalues"> <h3 class="title">Return Values</h3> <p class="para"> Returns <strong><code>TRUE</code></strong> on success or <strong><code>FALSE</code></strong> on failure. </p> </div> <div class="refsect1 examples" id="refsect1-httpresponse.send-examples"> <h3 class="title">Examples</h3> <p class="para"> <div class="example" id="example-4357"> <p><strong>Example #1 A <span class="function"><strong>HttpResponse::send()</strong></span> example</strong></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">"</span><span style="color: #0000BB">$user</span><span style="color: #DD0000">.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" id="refsect1-httpresponse.send-seealso"> <h3 class="title">See Also</h3> <p class="para"> <ul class="simplelist"> <li class="member"> <span class="methodname"><a href="httpresponse.capture.html" class="methodname" rel="rdfs-seeAlso">HttpResponse::capture()</a> - Capture script output</span></li> </ul> </p> </div> </div><hr /><div class="manualnavbar" style="text-align: center;"> <div class="prev" style="text-align: left; float: left;"><a href="httpresponse.redirect.html">HttpResponse::redirect</a></div> <div class="next" style="text-align: right; float: right;"><a href="httpresponse.setbuffersize.html">HttpResponse::setBufferSize</a></div> <div class="up"><a href="class.httpresponse.html">HttpResponse</a></div> <div class="home"><a href="index.html">PHP Manual</a></div> </div></body></html>