I have tried searching for a way to escape php in a string and have been unsuccessful. I basically want to be able to write a string that contains php without php parsing it.
The error:
Undefined Variable
Code
$file = fopen("test.php", "w");
$content = "<?php echo $somevariable; ?>";
fwrite($file, $content);
*updated to show variable in string.
<,?,petc... will get written out to the file.