我正在使用 Sublime,一些 PHP 文件没有封闭的 PHP 标签。这让 Sublime 感到困惑,并且没有代码高亮显示。即使将语法设置为 PHP 仍然会显示未高亮的代码
问题:没有标签
预期:带有标签
有什么想法吗?
最佳答案
When a file is included, parsing drops out of PHP mode and into HTML mode at the beginning of the target file, and resumes again at the end. For this reason, any code inside the target file which should be executed as PHP code must be enclosed within valid PHP start and end tags.
Sublime Text 只是遵循这个建议!
关于php - 如果未找到 PHP 标记,则 PHP 中的 Sublime 代码突出显示不起作用,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/35981930/