How can I make visual studio highlight .php files

2022-08-30 17:23:07

Hope the title explains it all, but all I'm trying to do is open some .php files in my web-site solution and have Visual studio treat them as if they are html files. I don't need the actual PHJP code highlighted (it's only includes). The HTML syntax should be parse-able, should it not?


答案 1

Tools -> Options -> Text Editor -> File Extension

in the Extension box, put .php. For the Editor, you can select HTML Editor. Click Add, then OK


答案 2

You can also install the PHP Tools for Visual Studio add-in. Tools > Extension and Updates and then search for PHP online. Your first result should be this add-in.

If not, you can get it from here:

http://visualstudiogallery.msdn.microsoft.com/6eb51f05-ef01-4513-ac83-4c5f50c95fb5


推荐