I'm sure this is going to seem obvious once someone explains it to me but...
I'm have some code that writes updated html files to my server. I want to embed some php code in the html. I've been experimenting with how to escape the code so it doesn't get parsed with the folowing results:
<?
$string = "<";
$string .= "?php echo(\"php is great\"); ?>";
echo "$string";
?>
Will output NOTHING.
I tried escaping the first echo
$string = "\<";
but all this output is only
.
If it delete the "<", the rest of the code is output fine.
<?
$string = "";
$string .= "?php echo(\"php is great\"); ?>";
echo "$string";
?>
Will output:
?php echo("php is great"); ?>
If I comment out the rest of the sting leaving only "<", I get this weird result:
How do I get complete PHP code into a file written by PHP?