function simple_html_dom_node::prev_sibling in simplehtmldom API 5.2
Same name and namespace in other branches
- 6 simplehtmldom/simple_html_dom.php \simple_html_dom_node::prev_sibling()
- 7 simplehtmldom/simple_html_dom.php \simple_html_dom_node::prev_sibling()
1 call to simple_html_dom_node::prev_sibling()
- simple_html_dom_node::previousSibling in simplehtmldom/
simple_html_dom.php
File
- simplehtmldom/
simple_html_dom.php, line 155
Class
Code
function prev_sibling() {
if ($this->parent === null) {
return null;
}
$idx = 0;
$count = count($this->parent->children);
while ($idx < $count && $this !== $this->parent->children[$idx]) {
++$idx;
}
if (--$idx < 0) {
return null;
}
return $this->parent->children[$idx];
}