You are here

protected function simple_html_dom::prepare in simplehtmldom API 7

Same name and namespace in other branches
  1. 5.2 simplehtmldom/simple_html_dom.php \simple_html_dom::prepare()
  2. 6 simplehtmldom/simple_html_dom.php \simple_html_dom::prepare()
1 call to simple_html_dom::prepare()
simple_html_dom::load in simplehtmldom/simple_html_dom.php

File

simplehtmldom/simple_html_dom.php, line 594

Class

simple_html_dom

Code

protected function prepare($str, $lowercase = true) {
  $this
    ->clear();
  $this->doc = $str;
  $this->pos = 0;
  $this->cursor = 1;
  $this->noise = array();
  $this->nodes = array();
  $this->lowercase = $lowercase;
  $this->root = new simple_html_dom_node($this);
  $this->root->tag = 'root';
  $this->root->_[HDOM_INFO_BEGIN] = -1;
  $this->root->nodetype = HDOM_TYPE_ROOT;
  $this->parent = $this->root;

  // set the length of content
  $this->size = strlen($str);
  if ($this->size > 0) {
    $this->char = $this->doc[0];
  }
}