How to remove all comments from multiple PHP documents at once?
How to remove all comments from multiple PHP documents at once?
The ideal is to use minification software. The only way to do it fully automatically and simply is this way. Even using an editor that accepts regular expressions, it is not easy to create a simple expression, imagine a complex one because it does not just take the pattern, it has a series of patterns that are worth or not worth, even because the comment may be inside a string , it can be nested, it can be part of another language code embedded in the main and other ways that what seems comment is not
Parsear code is too complex to leave for a very precarious tool. See more at: Comments weigh? .
Examples of minifiers for PHP . In the comments you have for HTML / CSS / HTML.