php8.5
Home/ Manual/ tidy / functions/ tidy_get_output

tidy_get_output

PHP function Edit on GitHub ✎

(PHP 5, PHP 7, PHP 8, PECL tidy >= 0.5.2)

Return a string representing the parsed tidy markup

Description

tidy_get_output(tidy $tidy): string

Gets a string with the repaired html.

Parameters

tidy

Object

Return Values

Returns the parsed tidy markup.

Examples

tidy_get_output() example

php
<?php

$html = '<p>paragraph</i>';
$tidy = tidy_parse_string($html);

$tidy->cleanRepair();

echo tidy_get_output($tidy);
?>

The above example will output:

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

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