I want to print php tags in php file so I am using
$variable="<?php
include("./$folder/$folder.php");
?>";
echo "$variable";
but its giving me error
Parse error: syntax error, unexpected T_STRING
I want to print php tags in php file so I am using
$variable="<?php
include("./$folder/$folder.php");
?>";
echo "$variable";
but its giving me error
Parse error: syntax error, unexpected T_STRING
You need to escape the double quotes using the backslash character (\):
$variable="<?php
include(\"./$folder/$folder.php\");
?>";
You can also clean up your echo expression by dropping the unnecessary quotes:
echo $variable;
$folder - It is unclear whether or not this is desired behavior.htmlentities function for the tags to be displayed properly.htmlspecialchars()< and > ie: echo "<php ...";