tidyNode::getNextSibling

(PHP 8 >= 8.4.0)

tidyNode::getNextSiblingRenvoie le noeud frère suivant du noeud courant

Description

public tidyNode::getNextSibling(): ?tidyNode

Renvoie le noeud frère suivant du noeud courant.

Liste de paramètres

Cette fonction ne contient aucun paramètre.

Valeurs de retour

Renvoie un tidyNode si le noeud a un frère suivant, ou null sinon.

Exemples

Exemple #1 Exemple de tidyNode::getNextSibling()

<?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[0]->getNextSibling()->value);

?>

L'exemple ci-dessus va afficher :

string(13) "<p>World</p>
"

Voir aussi

add a note

User Contributed Notes

There are no user contributed notes for this page.
To Top