• <legend id='Z8Byp'><style id='Z8Byp'><dir id='Z8Byp'><q id='Z8Byp'></q></dir></style></legend>

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

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

  • <tfoot id='Z8Byp'></tfoot>

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

        将php输出保存在文件中

        时间:2023-10-04

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

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

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

                  <tfoot id='GRv7q'></tfoot>

                  本文介绍了将php输出保存在文件中的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

                  问题描述

                  我有:

                  echo"
                  ";echo"

                  ";print_r($array2);echo"</pre>";echo"<br>";echo"<br><pre>";print_r($array3);echo"</pre>";echo"<br>";echo"<br><pre>";print_r($array4);echo"</pre>";

                  我需要将所有这些 print_r 打印的内容保存到一个文件中(不要在页面中打印任何内容).

                  我知道我需要做这样的事情:

                  $f = fopen("file.txt", "w");fwrite($f, "要写的文本");fclose($f);

                  但是我不知道怎么把里面的内容放在里面.

                  感谢一百万

                  解决方案

                  使用 print_r 中的 true 参数试试这个:

                  $f = fopen("file.txt", "w");fwrite($f, print_r($array2, true));fwrite($f, print_r($array3, true));fwrite($f, print_r($array4, true));fclose($f);

                  I have:

                  echo"<br>";echo"<br><pre>";print_r($array2);echo"</pre>";
                  echo"<br>";echo"<br><pre>";print_r($array3);echo"</pre>";
                   echo"<br>";echo"<br><pre>";print_r($array4);echo"</pre>";
                  

                  I need to save what all of these print_r print into a file (without pronting anything in the page).

                  I know I need to do something like that:

                  $f = fopen("file.txt", "w");
                  fwrite($f, "TEXT TO WRITE");
                  fclose($f); 
                  

                  But I don't know how to put the contents before in it.

                  Thansk a million

                  解决方案

                  Try this out using the true param in the print_r:

                  $f = fopen("file.txt", "w");
                  fwrite($f, print_r($array2, true));
                  fwrite($f, print_r($array3, true));
                  fwrite($f, print_r($array4, true));
                  fclose($f); 
                  

                  这篇关于将php输出保存在文件中的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持html5模板网!

                  上一篇:wkhtmltopdf:哪些纸张尺寸有效? 下一篇:自动打开 PDF 文件的打印机对话框

                  相关文章

                  最新文章

                • <small id='gGUIv'></small><noframes id='gGUIv'>

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

                • <legend id='gGUIv'><style id='gGUIv'><dir id='gGUIv'><q id='gGUIv'></q></dir></style></legend>

                  <tfoot id='gGUIv'></tfoot>

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