Shell – Strip // Comments From Files

PHPshell-scripttext processing

What's the best way to strip all code comments in a given directory? I'd like to strip out all // ... EOL comments, and /* blah \*/ (or /** ... \*/) comments as well.

This is a PHP project, and I'd like to go a little further than what is outlined below, yet for security purposes rather than efficiency.

Related Question