# Do you support PHP Tidy functions?

> Yes. The PHP Tidy extension is available on Ruachost hosting, so your scripts can clean up and repair HTML markup automatically.

Source: https://helpcenter.ruachost.com/faq/guides/do-you-support-php-tidy-functions/

**Yes.** The **Tidy** extension for PHP is available on Ruachost hosting.

Tidy cleans up and repairs HTML. It can fix tags that aren't closed, tidy up indentation and turn messy markup into valid HTML or XHTML. It's useful when you process HTML from users or other websites.

```php
<?php
$html = '<p>Unclosed paragraph<b>bold text';
$tidy = tidy_parse_string($html, ['indent' => true], 'utf8');
$tidy->cleanRepair();
echo $tidy;
```

## If you get a "Call to undefined function tidy_parse_string" error

PHP extensions are set for each PHP version. To switch Tidy on:

1. Log in to cPanel.
2. Open **Select PHP Version**.
3. Click **Extensions** and tick **tidy**.

See [Changing PHP versions and settings using PHP Selector](https://helpcenter.ruachost.com/cpanel/software/changing-php-versions-and-settings-using-php-selector/).

For the full list of Tidy functions, see the [PHP manual](https://www.php.net/manual/en/book.tidy.php).
