title: Saving php output in a file
body: <p>I have:</p>
  
  <pre><code>echo"&lt;br&gt;";echo"&lt;br&gt;&lt;pre&gt;";print_r($array2);echo"&lt;/pre&gt;";
  echo"&lt;br&gt;";echo"&lt;br&gt;&lt;pre&gt;";print_r($array3);echo"&lt;/pre&gt;";
   echo"&lt;br&gt;";echo"&lt;br&gt;&lt;pre&gt;";print_r($array4);echo"&lt;/pre&gt;";
  </code></pre>
  
  <p>I need to save what all of these print_r print into a file (without pronting anything in the page).</p>
  
  <p>I know I need to do something like that: </p>
  
  <pre><code>$f = fopen("file.txt", "w");
  fwrite($f, "TEXT TO WRITE");
  fclose($f); 
  </code></pre>
  
  <p>But I don't know how to put the contents before in it. </p>
  
  <p>Thansk a million</p>