Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我想在 php 文件中打印 php 标签,所以我正在使用
$variable="<?php include("./$folder/$folder.php"); ?>"; echo "$variable";
但它给了我错误
解析错误:语法错误,意外的 T_STRING
您需要使用反斜杠字符 ( \) 转义双引号:
\
$variable="<?php include(\"./$folder/$folder.php\"); ?>";
您还可以通过删除不必要的引号来清理您的echo表达式:
echo
echo $variable;