1. Go to this page and download the library: Download mallardduck/html-formatter library. Choose the download type require.
2. Extract the ZIP file and open the index.php.
3. Add this code to the index.php.
<?php
require_once('vendor/autoload.php');
/* Start to develop here. Best regards https://php-download.com/ */
mallardduck / html-formatter example snippets
use MallardDuck\HtmlFormatter\Formatter;
$input = 'This is your HTML code.';
$formatter = new Formatter();
$output = $formatter->beautify($input);
use MallardDuck\HtmlFormatter\Formatter;
$formatter = new Formatter();
$config = $formatter->getConfig();
$config->append('inline.tag', 'foo')->subtract('inline.tag', ['bar', 'baz']);
$formatter->setConfig($config);
use MallardDuck\HtmlFormatter\Formatter;
$formatter = new Formatter();
$formatter->setConfig($formatter->getConfig()->append('self-closing.tag', ['foo', 'bar']));
use MallardDuck\HtmlFormatter\Formatter;
$formatter = new Formatter();
$config = $formatter->getConfig();
$config->set('formatted.tag.script.cleanup-empty', false);
$formatter->setConfig($config);
Loading please wait ...
Before you can download the PHP files, the dependencies should be resolved. This can take some minutes. Please be patient.