Is there anyway that Notepad ++ highlights both PHP and HTML at the same time?

I used Notepad ++ to edit PHP with repeating HTML tags. Notepad ++ always stood out and interacted with HTML, CSS, Javascript and PHP code in one document.

In the latest versions, apparently, only the PHP code is highlighted, and the rest of the code is HTML, CSS, Javscript just turns gray and grouped together.

Here is a screenshot of what html and javascript look like. Switching the language from the menu bar in PHP, HTML or Javascript does not change anything.

Can this function be turned on again?

+4
source share
2 answers

Looking at the screenshot, it seems that your markup is in a line that repeats. In this case, Notepad ++ works fine, highlighting the entire string as a PHP string.

Remember that you do not need to use echo to print HTML. You can embed PHP in HTML (or HTML in PHP) using the opening and closing PHP delimiters to break out and return to the PHP code anywhere in your files (see manual ). If you close your PHP code with ?> Instead of using echo " and open it at the end of the line with <?php instead of "; , your HTML should display again as HTML.

+4
source

Fortunately not.

I ran into this problem. Then, after an hour of trying to enable this “feature”, I realized: hey, at this moment I have to use the templates anyway .

After some consideration, I came to the conclusion that Notepad ++ should not do this in order to encourage good coding techniques.

I am only embarrassed that it took me so long to understand that it was not my job with the editor to make my code readable, but mine.

GLHF

+1
source

All Articles