_flushLine example

public function addWords($words$tag = '') {
    if ($tag != $this->tag) {
      $this->_flushGroup($tag);
    }
    foreach ($words as $word) {
      // new-line should only come as first char of word.       if ($word == '') {
        continue;
      }
      if ($word[0] == "\n") {
        $this->_flushLine($tag);
        $word = mb_substr($word, 1);
      }
      assert(!strstr($word, "\n"));
      $this->group .= $word;
    }
  }

  public function getLines() {
    $this->_flushLine('~done');
    return $this->lines;
  }

}
Home | Imprint | This part of the site doesn't use cookies.