I've used Notepad++ for PHP editing with HTML tags echoed out. Notepad++ had always highlighted, and interacted with the HTML, CSS, Javascript, and PHP code all in the same document.
The latest versions seem to only highlight PHP code only, and all the rest of the code be it HTML, CSS, Javscript just gets greyed out, and bunched together.
Here's the screenshot of how the html and javascript look. Switching the language from the menu bar to PHP, HTML, or Javascript doesn't change anything though.
Is there any way to enable this feature again?
Thankfully, no.
I ran into this 'problem' too. Then after an hour of trying to enable this 'feature' I realized: hey, at this point, I should be using templates anyway.
After some consideration I've come to the conclusion that Notepad++ shouldn't do this, to encourage good coding practices.
I'm only embarrassed that it took me so long to realize that it was no longer my editor's job to make my code readable, but mine.
GLHF
Looking at the screenshot, it seems your markup is all in a string that's being echoed out. In that case, Notepad++ is acting normally, highlighting the entire string as a PHP string.
Remember that you don't need to use
echo
to print HTML. You can embed PHP in HTML (or HTML in PHP) by using PHP's opening and closing delimiters to break out and back in to PHP code anywhere in your files (see the manual). If you close your PHP code with?>
rather than useecho "
, and open it back up at the end of the string with<?php
instead of";
, your HTML should highlight as HTML again.