1

Can anyone tell me how I can format HTML inside of a .php file? If I could also format php code at the same time it would help a lot.

By format I mean automatically add the correct tab spacing between lines and elements.

All I can find is PHP extensions, extensions to format PHP or extensions to format HTML code in Visual Studio Code.

Cory Tutton
  • 59
  • 1
  • 4
  • Code formatting is called linting. – ifconfig Sep 30 '17 at 17:03
  • It's a long shot, but see the answer here https://stackoverflow.com/questions/41330707/how-to-format-php-files-with-html-markup-in-visual-studio-code?noredirect=1&lq=1 about using the beautify extension. – Mark Oct 03 '17 at 07:21

1 Answers1

0

According to its documentation, this VS Code Marketplace extension supports HTML and CSS linting within .php files.

ifconfig
  • 6,242
  • 7
  • 41
  • 65
  • This doesn't add the 4 spaces when I enter a new line, and it doesn't format my document in any way. I wouldn't call this formatting – Cory Tutton Sep 30 '17 at 17:08