Reputation: 21
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
Upvotes: 0
Views: 1648
Reputation:
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;
Upvotes: 4