For part of my website I need to be able to write php code to a file with php. For example:
$filename = \"RtestR.php\"; $ourFileName =$filename; $ourFileHand
You're missing your closing PHP tag ?>.
?>
Consider for a moment that what you are doing might not be the best approach anyway. The only use case I can think of for writing out PHP files with PHP would be for some compiled template code or weird caching.