php8.5
Home/ Manual/ tidy / tidy/ tidy::html

tidy::html

PHP function Edit on GitHub ✎

Returns a tidyNode object starting from the <html> tag of the tidy parse tree

Description

Oop

tidy::html(): tidyNode|null

Procedural

tidy_get_html(tidy $tidy): tidyNode|null

Returns a tidyNode object starting from the <html> tag of the tidy parse tree.

Parameters

tidy

Object

Return Values

Returns the tidyNode object.

Examples

tidy::html() example

php
<?php
$html = '
<html>
  <head>
    <title>test</title>
  </head>
  <body>
    <p>paragraph</p>
  </body>
</html>';

$tidy = tidy_parse_string($html);

$html = $tidy->html();
echo $html->value;
?>

The above example will output:

output
<html>
<head>
<title>test</title>
</head>
<body>
<p>paragraph</p>
</body>
</html>

See Also

Source: reference/tidy/tidy/html.xml · from the official PHP manual (php/doc-en)