Writing a variable to file PHP
<p>When I execute this:</p>

<pre><code>$filename = "test.php";
$content = "&lt;?php $variable = 35 ?&gt;";
file_put_contents($filename,$content);
</code></pre>

<p>The file contains this:</p>

<pre><code>&lt;?php  =35?&gt;
</code></pre>

<p>How can I get it to include the $variable ?</p>

<p>Also, how can I append this to the top of the file without overwriting existing data?</p>
