array ( 0 => 'index.php', 1 => 'PHP Manual', ), 'head' => array ( 0 => 'UTF-8', 1 => 'uk', ), 'this' => array ( 0 => 'tidynode.getprevioussibling.php', 1 => 'tidyNode::getPreviousSibling', 2 => 'Returns the previous sibling node of the current node', ), 'up' => array ( 0 => 'class.tidynode.php', 1 => 'tidyNode', ), 'prev' => array ( 0 => 'tidynode.getparent.php', 1 => 'tidyNode::getParent', ), 'next' => array ( 0 => 'tidynode.haschildren.php', 1 => 'tidyNode::hasChildren', ), 'alternatives' => array ( ), 'source' => array ( 'lang' => 'en', 'path' => 'reference/tidy/tidynode/getprevioussibling.xml', ), 'history' => array ( ), ); $setup["toc"] = $TOC; $setup["toc_deprecated"] = $TOC_DEPRECATED; $setup["parents"] = $PARENTS; manual_setup($setup); contributors($setup); ?>
(PHP 8 >= 8.4.0)
tidyNode::getPreviousSibling — Returns the previous sibling node of the current node
Returns the previous sibling node of the current node.
У цієї функції немає параметрів.
Приклад #1 tidyNode::getPreviousSibling() example
<?php
$html = <<< HTML
<html>
<head>
</head>
<body>
<p>Hello</p><p>World</p>
</body>
</html>
HTML;
$tidy = tidy_parse_string($html);
$node = $tidy->body();
var_dump($node->child[1]->getPreviousSibling()->value);
?>
Поданий вище приклад виведе:
string(13) "<p>Hello</p> "