roesch / html-format
A simple to use HTML prettifier class written in PHP. Added as a composer library in memory of Bennett Roesch (spyrosoft)
Installs: 174
Dependents: 0
Suggesters: 0
Security: 0
Stars: 2
Watchers: 1
Forks: 1
Open Issues: 0
pkg:composer/roesch/html-format
Requires
- php: ~5.6|~7.0
Requires (Dev)
- phpunit/phpunit: 4.*
This package is auto-updated.
Last update: 2025-10-14 08:32:08 UTC
README
A simple to use HTML prettifier class written in PHP. Added as a composer library in memory of Bennett Roesch (spyrosoft).
Original code from: https://github.com/spyrosoft/php-format-html-output
Install
Require this package with composer using the following command:
$ composer require roesch/html-format
Example usage:
<?php
require 'vendor/autoload.php';
$html = 'Unformatted HTML string';
// initialize class
$format = new \Roesch\Format();
// use spaces at 4 length
echo $format->html($html);
// use spaces at 2 length
echo $format->html($html, true, 2);
// use tabs
echo $format->html($html, false);
Static method example usage:
<?php
require 'vendor/autoload.php';
$html = 'Unformatted HTML string';
// use spaces at 4 length
echo \Roesch\Format::HTML($html);
// use spaces at 2 length
echo \Roesch\Format::HTML($html, true, 2);
// use tabs
echo \Roesch\Format::HTML($html, false);
Testing
$ composer test
Contributing
Please see CONTRIBUTING for details.
Credits
License
The MIT License (MIT). Please see License File for more information.