Sophie

Sophie

distrib > Mageia > 7 > i586 > by-pkgid > 2b917e0437961edec048f1d15e2d7449 > files > 11098

php-manual-en-7.2.11-1.mga7.noarch.rpm

<!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>Basic usage</title>

 </head>
 <body><div class="manualnavbar" style="text-align: center;">
 <div class="prev" style="text-align: left; float: left;"><a href="outcontrol.examples.html">Examples</a></div>
 <div class="next" style="text-align: right; float: right;"><a href="outcontrol.examples.rewrite.html">Output rewrite usage</a></div>
 <div class="up"><a href="outcontrol.examples.html">Examples</a></div>
 <div class="home"><a href="index.html">PHP Manual</a></div>
</div><hr /><div id="outcontrol.examples.basic" class="section">
  <h2 class="title">Basic usage</h2>
  <p class="para">
   <div class="example" id="example-505">
    <p><strong>Example #1 Output Control example</strong></p>
    <div class="example-contents">
<div class="phpcode"><code><span style="color: #000000">
<span style="color: #0000BB">&lt;?php<br /><br />ob_start</span><span style="color: #007700">();<br />echo&nbsp;</span><span style="color: #DD0000">"Hello\n"</span><span style="color: #007700">;<br /><br /></span><span style="color: #0000BB">setcookie</span><span style="color: #007700">(</span><span style="color: #DD0000">"cookiename"</span><span style="color: #007700">,&nbsp;</span><span style="color: #DD0000">"cookiedata"</span><span style="color: #007700">);<br /><br /></span><span style="color: #0000BB">ob_end_flush</span><span style="color: #007700">();<br /><br /></span><span style="color: #0000BB">?&gt;</span>
</span>
</code></div>
    </div>

   </div>
  </p>
  <p class="para">
   In the above example, the output from <span class="function"><a href="function.echo.html" class="function">echo</a></span>
   would be stored in the output buffer until
   <span class="function"><a href="function.ob-end-flush.html" class="function">ob_end_flush()</a></span> was called. In the mean time,
   the call to <span class="function"><a href="function.setcookie.html" class="function">setcookie()</a></span> successfully stored a
   cookie without causing an error. (Headers cannot normally be sent
   to the browser after data has already been sent.)
  </p>
 </div><hr /><div class="manualnavbar" style="text-align: center;">
 <div class="prev" style="text-align: left; float: left;"><a href="outcontrol.examples.html">Examples</a></div>
 <div class="next" style="text-align: right; float: right;"><a href="outcontrol.examples.rewrite.html">Output rewrite usage</a></div>
 <div class="up"><a href="outcontrol.examples.html">Examples</a></div>
 <div class="home"><a href="index.html">PHP Manual</a></div>
</div></body></html>