public function QueryPath::odd in QueryPath 6
Same name and namespace in other branches
- 7.3 QueryPath/QueryPath.php \QueryPath::odd()
- 7.2 QueryPath/QueryPath.php \QueryPath::odd()
File
- QueryPath/
QueryPath.php, line 1665
Class
Code
public function odd() {
$found = new SplObjectStorage();
$odd = true;
foreach ($this->matches as $m) {
if ($odd && $m->nodeType == XML_ELEMENT_NODE) {
$found
->attach($m);
}
$odd = $odd ? false : true;
}
$this
->setMatches($found);
$this->matches = $found;
return $this;
}