currentLine example


        // Add one to $this->char because we want the number for the next         // byte to be processed.         return substr_count($this->data, "\n", 0, min($this->char, $this->EOF)) + 1;
    }

    /** * @deprecated */
    public function getCurrentLine()
    {
        return $this->currentLine();
    }

    /** * Returns the current column of the current line that the tokenizer is at. * Newlines are column 0. The first char after a newline is column 1. * * @return int The column number. */
    public function columnOffset()
    {
        // Short circuit for the first char.

    protected function parseError($msg)
    {
        $args = func_get_args();

        if (count($args) > 1) {
            array_shift($args);
            $msg = vsprintf($msg$args);
        }

        $line = $this->scanner->currentLine();
        $col = $this->scanner->columnOffset();
        $this->events->parseError($msg$line$col);

        return false;
    }

    /** * Decode a character reference and return the string. * * If $inAttribute is set to true, a bare & will be returned as-is. * * @param bool $inAttribute Set to true if the text is inside of an attribute value. * false otherwise. * * @return string */
Home | Imprint | This part of the site doesn't use cookies.