private function up_to_str($str) { $pos = $this->pos; $this->pos = strpos($this->html, $str, $pos); if ($this->pos === false) { // finish $this->pos = $this->len; } return substr($this->html, $pos, $this->pos - $pos); }