How to create a new php file from template
<p>I am certainly not an expert in PHP, and have surfed SO thoroughly but didn't find anything related to this. Might mean that the question is stupid, but I was trying to create a new php file on sign up (so to provide rss feeds for each person who signs up) and I've managed so far to create a beatifully empty file. Here's the code of a test file I have written in the end, with GET function:</p>

<pre><code>$USR = $_GET['usr'];
$FILE=$USR.'.rss.php';
$file1 = 'rssdemo.php'; 
$handle = fopen($file1, 'a'); 
$contents = fread($handle, filesize($file1)); 
fclose($handle); 
        $file2 =$FILE; 
        $handle = fopen($file2, 'wb'); 
        fwrite($handle, $contents);  //this should write something but does nothing   
        fclose($handle); 
</code></pre>

<p>As you can see, the file I am trying to copy from is a PHP file (that should in its turn generate the XML file). 
Is there a way to create a new php file, open an old one, copy the content of it and paste it into the newly created file? Or maybe fwrite () can be used for text only? Some help please! Thanks in advance.</p>
