title: How to insert template in php file
body: <p>I 've used the following code to create PHP file dynamically </p>
  
  <pre><code>$value = 5;
  $file = $compname.'.php';
  $file_pointer = fopen( $file, 'w' );
  $string = '&lt;?php $var = '. $value .' ?&gt;';
  fwrite( $file_pointer, $string );
  fclose($file_pointer);
  include($file);
  echo $var;
  </code></pre>
  
  <p>Is it possible to insert template in that php file and the file name conatins spaces is it possible to remove those space and add "-" </p>