outcontrol.examples.html
来自「php的帮助文档,涉及到PHP的案例和基本语法,以及实际应用内容」· HTML 代码 · 共 45 行
HTML
45 行
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"><html> <head> <title>Examples</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="outcontrol.constants.html">Predefined Constants</a></div> <div class="next" style="text-align: right; float: right;"><a href="ref.outcontrol.html">Output Control Functions</a></div> <div class="up"><a href="book.outcontrol.html">Output Control</a></div> <div class="home"><a href="index.html">PHP Manual</a></div></div><hr /><div> <h1>Examples</h1> <div id="outcontrol.examples.basic" class="section"> <h2 class="title">Examples</h2> <p class="para"> <div class="example"> <p><b>Example #1 Output Control example</b></p> <div class="example-contents"><div class="phpcode"><code><span style="color: #000000"><span style="color: #0000BB"><?php<br /><br />ob_start</span><span style="color: #007700">();<br />echo </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">, </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">?></span></span></code></div> </div> </div> </p> <p class="para"> In the above example, the output from <a href="function.echo.html" class="function">echo()</a> would be stored in the output buffer until <a href="function.ob-end-flush.html" class="function">ob_end_flush()</a> was called. In the mean time, the call to <a href="function.setcookie.html" class="function">setcookie()</a> successfully stored a cookie without causing an error. (You can not normally send headers to the browser after data has already been sent.) </p> </div></div><hr /><div style="text-align: center;"> <div class="prev" style="text-align: left; float: left;"><a href="outcontrol.constants.html">Predefined Constants</a></div> <div class="next" style="text-align: right; float: right;"><a href="ref.outcontrol.html">Output Control Functions</a></div> <div class="up"><a href="book.outcontrol.html">Output Control</a></div> <div class="home"><a href="index.html">PHP Manual</a></div></div></body></html>
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?