public function QueryPath::text in QueryPath 7.2
Same name and namespace in other branches
- 6 QueryPath/QueryPath.php \QueryPath::text()
- 7.3 QueryPath/QueryPath.php \QueryPath::text()
File
- QueryPath/
QueryPath.php, line 1251
Class
Code
public function text($text = NULL) {
if (isset($text)) {
$this
->removeChildren();
$textNode = $this->document
->createTextNode($text);
foreach ($this->matches as $m) {
$m
->appendChild($textNode);
}
return $this;
}
$buf = '';
foreach ($this->matches as $m) {
$buf .= $m->textContent;
}
return $buf;
}