• <bdo id='JGAAX'></bdo><ul id='JGAAX'></ul>

      1. <legend id='JGAAX'><style id='JGAAX'><dir id='JGAAX'><q id='JGAAX'></q></dir></style></legend>

      2. <tfoot id='JGAAX'></tfoot>
        <i id='JGAAX'><tr id='JGAAX'><dt id='JGAAX'><q id='JGAAX'><span id='JGAAX'><b id='JGAAX'><form id='JGAAX'><ins id='JGAAX'></ins><ul id='JGAAX'></ul><sub id='JGAAX'></sub></form><legend id='JGAAX'></legend><bdo id='JGAAX'><pre id='JGAAX'><center id='JGAAX'></center></pre></bdo></b><th id='JGAAX'></th></span></q></dt></tr></i><div id='JGAAX'><tfoot id='JGAAX'></tfoot><dl id='JGAAX'><fieldset id='JGAAX'></fieldset></dl></div>

        <small id='JGAAX'></small><noframes id='JGAAX'>

        PHP-“标头已发送"错误取决于输出长度?

        时间:2023-11-30

          <tbody id='bcImX'></tbody>
      3. <i id='bcImX'><tr id='bcImX'><dt id='bcImX'><q id='bcImX'><span id='bcImX'><b id='bcImX'><form id='bcImX'><ins id='bcImX'></ins><ul id='bcImX'></ul><sub id='bcImX'></sub></form><legend id='bcImX'></legend><bdo id='bcImX'><pre id='bcImX'><center id='bcImX'></center></pre></bdo></b><th id='bcImX'></th></span></q></dt></tr></i><div id='bcImX'><tfoot id='bcImX'></tfoot><dl id='bcImX'><fieldset id='bcImX'></fieldset></dl></div>

            <bdo id='bcImX'></bdo><ul id='bcImX'></ul>

              <legend id='bcImX'><style id='bcImX'><dir id='bcImX'><q id='bcImX'></q></dir></style></legend>
            1. <tfoot id='bcImX'></tfoot>

                  <small id='bcImX'></small><noframes id='bcImX'>

                • 本文介绍了PHP-“标头已发送"错误取决于输出长度?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着跟版网的小编来一起学习吧!

                  问题描述

                  我有一个输出 mysql 单元数据的脚本.内容"单元格包含长度不同的文本输出.

                  I have a script which outputs mysql cell data. The "content" cell contains text output, which is of varied length.

                  当内容"单元格的内容很小(比如说,几行文本)时,一切正常.但是,当输出达到多个段落或更多段落时,我会收到标头已发送"错误.

                  When the contents of the "content" cell are small (lets say, a few lines of text), everything works fine. However, when the output reaches several paragraphs or more, I get the 'headers already sent' error.

                  它取决于输出长度吗?我在哪里可以阅读更多关于它的信息?我在 SO 上找到的答案没有提到这种输出长度依赖性.

                  Does it depend on the output length? Where can I read more about it? The answers I've found on SO mention nothing of such output length-dependency.

                   44:   echo "
                   45:       <p>".$article['content']."</p>
                   46:   ";
                  

                  如果内容"输出的大小很大,脚本会产生以下错误:

                  If the size of the 'content' output is large, the script produces the following error:

                  PHP 警告:无法修改标头信息 - 标头已发送通过(输出开始于/home/mantas/htdocs/asm/article.php:46)在/home/mantas/htdocs/asm/include/comments_class.php 第 56 行

                  PHP Warning: Cannot modify header information - headers already sent by (output started at /home/mantas/htdocs/asm/article.php:46) in /home/mantas/htdocs/asm/include/comments_class.php on line 56

                  推荐答案

                  如果你愿意,PHP 会缓冲输出.您可以使用 ob_start() 等以编程方式对此进行控制.但是,还有一个选项可以在 php.ini 中设置输出缓冲.

                  PHP will buffer output if you want it to. You can control this programmatically with ob_start(), etc. However, there is a further option to set output buffering on in php.ini.

                  设置 output_buffering=on 启用它,而设置 output_buffering=4096 将设置缓冲区大小限制.phpinfo() 应该告诉你这是否启用,以及缓冲区大小是多少.

                  Setting output_buffering=on enables it, while setting output_buffering=4096 will set a limit to the buffer size. phpinfo() should tell you if this is enabled, and what the buffer size is.

                  PHP 参考是这里

                  这篇关于PHP-“标头已发送"错误取决于输出长度?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持跟版网!

                  上一篇:symfony - 下载文件 下一篇:增加标题的宽度

                  相关文章

                  1. <i id='zaKfJ'><tr id='zaKfJ'><dt id='zaKfJ'><q id='zaKfJ'><span id='zaKfJ'><b id='zaKfJ'><form id='zaKfJ'><ins id='zaKfJ'></ins><ul id='zaKfJ'></ul><sub id='zaKfJ'></sub></form><legend id='zaKfJ'></legend><bdo id='zaKfJ'><pre id='zaKfJ'><center id='zaKfJ'></center></pre></bdo></b><th id='zaKfJ'></th></span></q></dt></tr></i><div id='zaKfJ'><tfoot id='zaKfJ'></tfoot><dl id='zaKfJ'><fieldset id='zaKfJ'></fieldset></dl></div>
                      <bdo id='zaKfJ'></bdo><ul id='zaKfJ'></ul>
                    <legend id='zaKfJ'><style id='zaKfJ'><dir id='zaKfJ'><q id='zaKfJ'></q></dir></style></legend>

                    <small id='zaKfJ'></small><noframes id='zaKfJ'>

                    1. <tfoot id='zaKfJ'></tfoot>