问题
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