PHP syntax check on .html files in NetBeans

冷暖自知 提交于 2019-12-22 00:53:14

问题


I am using NetBeans IDE 8.0.1 for my PHP development.

I like the syntax check feature in netbeans. But the problem that I have is that it only works with files that have .php extension .

I am using a lot of php code in files with .html extension, and no php syntax checking is being available in NetBeans for those files.

Is it possible to enable php syntax checking for .html files?


回答1:


One hacky way to do that:

  • go to Tools|Options|Miscellanous
  • select Files tab
  • from File extensions, select HTML
  • from Associated MIME type, select text/x-php5

Then NetBeans will consider all HTML files as PHP ones




回答2:


Well if your files have .html extension then it will never be able to execute the php code and to execute php code the extension must be .php as PHP stands for Hypertext Pre-processor so it is processed before HTML.



来源:https://stackoverflow.com/questions/27183362/php-syntax-check-on-html-files-in-netbeans

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!