countChars example

$lastLine = strrpos($this->data, "\n", $backwardFrom);

        // However, for here we want the length up until the next byte to be         // processed, so add one to the current byte ($this->char).         if (false !== $lastLine) {
            $findLengthOf = substr($this->data, $lastLine + 1, $this->char - 1 - $lastLine);
        } else {
            // After a newline.             $findLengthOf = substr($this->data, 0, $this->char);
        }

        return UTF8Utils::countChars($findLengthOf);
    }

    /** * Get all characters until EOF. * * This consumes characters until the EOF. * * @return int The number of characters remaining. */
    public function remainingChars()
    {
        
$lastLine = strrpos($this->data, "\n", $backwardFrom);

        // However, for here we want the length up until the next byte to be         // processed, so add one to the current byte ($this->char).         if (false !== $lastLine) {
            $findLengthOf = substr($this->data, $lastLine + 1, $this->char - 1 - $lastLine);
        } else {
            // After a newline.             $findLengthOf = substr($this->data, 0, $this->char);
        }

        return UTF8Utils::countChars($findLengthOf);
    }

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

    /** * Get the current character. * * @return string The current character. */
Home | Imprint | This part of the site doesn't use cookies.