PHPFixing
  • Privacy Policy
  • TOS
  • Ask Question
  • Contact Us
  • Home
  • PHP
  • Programming
  • SQL Injection
  • Web3.0

Tuesday, May 17, 2022

[FIXED] Why is VS Code removing closing tag ?> on save. anyone knows?

 May 17, 2022     php, tags     No comments   

Issue

when i save my php file then VS Code removes ?> tag from ending. and its causing problems in execution. I dont know why is this happening. If anyone knows please help. Thank u.

Update: I was using Es-lint and Prettier extensions at the same time. I removed them and now its fine.


Solution

I find two ways to solve this problem.

  1. Go to VSCode settings and in the search bar type "format", then uncheck Editor: Format on save. Formatting the code will no longer work, but VSCode will also not delete the PHP closing tag.

  2. Install the php cs fixer extension and I hope it will solve the issue.



Answered By - Vukasin
Answer Checked By - Dawn Plyler (PHPFixing Volunteer)
  • Share This:  
  •  Facebook
  •  Twitter
  •  Stumble
  •  Digg
Newer Post Older Post Home

0 Comments:

Post a Comment

Note: Only a member of this blog may post a comment.

Total Pageviews

Featured Post

Why Learn PHP Programming

Why Learn PHP Programming A widely-used open source scripting language PHP is one of the most popular programming languages in the world. It...

Subscribe To

Posts
Atom
Posts
Comments
Atom
Comments

Copyright © PHPFixing