Tidy tidyNode::hasSiblings

(PHP 5, PHP 7, PHP 8)

tidyNode::hasSiblings — 노드에 형제가 있는지 확인


설명

public tidyNode::hasSiblings(): bool

노드에 형제가 있는지 알려줍니다.


매개변수

이 함수에는 매개변수가 없습니다.


반환 값

노드에 형제가 있으면 true를 반환하고 그렇지 않으면 false를 반환합니다.


Examples

예제 #1 tidyNode::hasSiblings() 예제

                  
<?php

$html = <<< HTML
<html><head>
<?php echo '<title>title</title>'; ?>
<#
  /* JSTE code */
  alert('Hello World');
#>
</head>
<body>

<?php
  // PHP code
  echo 'hello world!';
?>

<%
  /* ASP code */
  response.write("Hello World!")
%>

<!-- Comments -->
Hello World
</body></html>
Outside HTML
HTML;


$tidy = tidy_parse_string($html);
$num = 0;

// the html tag
var_dump($tidy->html()->hasSiblings());

// the head tag
var_dump($tidy->html()->child[0]->hasSiblings());

?>
                  
                

위의 예는 다음을 출력합니다.

bool(false)
bool(true)