Utility class used in Denshoch softwares.
composer install
Remove Unicode control characters from input text.
$text = "�";
\Denshoch\Utils::removeControlChars( $text );
var_dump( $text ); #=> ''
$html = "<div><p>Hello, world!</p></div>";
$result = \Denshoch\HtmlModifier::addClass($html, 'p', 'my-class');
=> '<div><p class="my-class">Hello, world!</p></div>'
$html = "<div><p>Hello, world!</p></div>";
$tagClassPairs = [
'p' => 'my-class',
'div' => 'my-other-class'
];
$result = HtmlModifier::addClassMultiple($html, $tagClassPairs);
=> '<div class="my-other-class"><p class="my-class">Hello, world!</p></div>'
vendor/bin/phpunit --bootstrap vendor/autoload.php tests