使用PHP minify(提供链接),如何抑制/删除所有注释?

Using PHP minify (http://code.google.com/p/minify/) how can ALL comments be suppressed/removed from the end result of the minification? At present all comments in javascript files of the format (any number of lines):

/*
 * 
 * comments...
 * 
 */

Are not being removed and appear in the final minified result (despite the code being minified successfully)..

Any help would be much appreciated!

Try the token_get_all()...

<?php

$sampleCode = "
<?php
/**
 * This is a comment
 */
function foo() {
    $x = 1;
    $y = $x + 1;
    return $y;
}
";


$tokens = token_get_all($sampleCode);
$cleanedCode = "";
foreach ($tokens as $token) {
    if (is_array($token)) {
        if ($token[0] != T_COMMENT && $token[0] != T_DOC_COMMENT) {
            $cleanedCode .= $token[1];
        }
    } else {
        $cleanedCode .= $token;
    }

}


?>