title: Writing PHP Code to a File
body: <p>I am wondering if it is possible to write php code to a file.  For example:</p>
  
  <pre><code>fwrite($handle, "&lt;?php $var = $var2 ?&gt;");
  </code></pre>
  
  <p>I would like it produce the exact string in the file and not the eval'ed code.  Is this possible?</p>
  
  <p>I am currently getting the following output (where $var = 1 and $var2 = 2):</p>
  
  <pre><code>&lt;?php 1 = 2 ?&gt;
  </code></pre>
  
  <p>Whereas I want the actual string:</p>
  
  <pre><code>&lt;?php $var = $var2 ?&gt;
  </code></pre>
  
  <p>Thanks for the help</p>