src/FreeFW/Tools/PBXString.php
public static function removeComments($output)
    {
        $lines  = explode("\n", $output);
        $output = "";
        // try to keep mem. use down
        $linecount  = count($lines);
        $in_comment = false;
        for ($i=0; $i<$linecount; $i++) {
            if (preg_match("/^\/\*/", $lines[$i])) {
                $in_comment = true;
            }
            if (!$in_comment) {
                $output .= $lines[$i] . "\n";
            }
            if (preg_match("/\*\/$/", $lines[$i])) {
                $in_comment = false;
            }
        }
        unset($lines);
        return $output;
    }
public static function removeComments($output)
    {
        $lines  = explode("\n", $output);
        $output = "";
        // try to keep mem. use down
        $linecount  = count($lines);
        $in_comment = false;
        for ($i=0; $i<$linecount; $i++) {
            if (preg_match("/^\/\*/", $lines[$i])) {
                $in_comment = true;
            }
            if (!$in_comment) {
                $output .= $lines[$i] . "\n";
            }
            if (preg_match("/\*\/$/", $lines[$i])) {
                $in_comment = false;
            }
        }
        unset($lines);
        return $output;
    }
public static function removeComments ( $ output ) { $ lines = explode ( "\n" , $ output ) ; $ output = "" ; // try to keep mem. use down $ linecount = count ( $ lines ) ; $ in_comment = false ; for ( $ i = 0 ; $ i < $ linecount ; $ i ++ ) { if ( preg_match ( "/^\/\*/" , $ lines [ $ i ] ) ) { $ in_comment = true ; } if ( ! $ in_comment ) { $ output .= $ lines [ $ i ] . "\n" ; } if ( preg_match ( "/\*\/$/" , $ lines [ $ i ] ) ) { $ in_comment = false ; } } unset ( $ lines ) ; return $ output ; }
Remove comments from string

@param string $output

@return string
Remove comments from string