protected function _hasUnclosedQuotes($string)
    {
        $string = trim($string);
        $iMax = strlen($string);
        $in_quote = false;
        $i = $slashes = 0;

        for (; $i < $iMax; ++$i) {
            switch ($string[$i]) {
            case '\\':
                ++$slashes;
                break;

            case '"':
                if ($slashes % 2 == 0) {
                    $in_quote = !$in_quote;
                }
                // Fall through to default action below.

            default:
                $slashes = 0;
                break;
            }
        }

        return $in_quote;
    }
protected function _hasUnclosedQuotes($string)
    {
        $string = trim($string);
        $iMax = strlen($string);
        $in_quote = false;
        $i = $slashes = 0;

        for (; $i < $iMax; ++$i) {
            switch ($string[$i]) {
            case '\\':
                ++$slashes;
                break;

            case '"':
                if ($slashes % 2 == 0) {
                    $in_quote = !$in_quote;
                }
                // Fall through to default action below.

            default:
                $slashes = 0;
                break;
            }
        }

        return $in_quote;
    }
protected function _hasUnclosedQuotes ( $ string ) { $ string = trim ( $ string ) ; $ iMax = strlen ( $ string ) ; $ in_quote = false ; $ i = $ slashes = 0 ; for ( ; $ i < $ iMax ; ++ $ i ) { switch ( $ string [ $ i ] ) { case '\\' : ++ $ slashes ; break ; case '"' : if ( $ slashes % 2 == 0 ) { $ in_quote = ! $ in_quote ; } // Fall through to default action below. default : $ slashes = 0 ; break ; } } return $ in_quote ; }
Checks if a string has unclosed quotes or not.

@param string $string  The string to check.
@return boolean  True if there are unclosed quotes inside the string,
false otherwise.
Checks if a string has unclosed quotes or not .