Microsoft Visual Studio does not build to write PHP, but it does support with an extension called PHP Tools for Visual Studio. The PHP Tools extension provided by DevSense, they also placed a video on YouTube to explain how to use PHP in visual studio. The initial 30 days it is free but later you need to purchase it.

Please go through the below Youtube video to understand the PHP Tools for Visual Studio: