simple_html_dom::copy_until_char_escape PHP Method

copy_until_char_escape() protected method

protected copy_until_char_escape ( $char )
    protected function copy_until_char_escape($char)
    {
        if ($this->char === null) {
            return '';
        }
        $start = $this->pos;
        while (1) {
            if (($pos = strpos($this->doc, $char, $start)) === false) {
                $ret = substr($this->doc, $this->pos, $this->size - $this->pos);
                $this->char = null;
                $this->pos = $this->size;
                return $ret;
            }
            if ($pos === $this->pos) {
                return '';
            }
            if ($this->doc[$pos - 1] === '\\') {
                $start = $pos + 1;
                continue;
            }
            $pos_old = $this->pos;
            $this->char = $this->doc[$pos];
            $this->pos = $pos;
            return substr($this->doc, $pos_old, $pos - $pos_old);
        }
    }